It’s possible, using the SPA mode.
You’ll need to use the router-module to use IonicVueRouter
:
import Vue from 'vue';
import { IonicVueRouter } from '@ionic/vue';
import Home from '@/pages/index';
Vue.use(IonicVueRouter);
export function createRouter() {
return new IonicVueRouter({
mode: 'history',
routes: [
{
path: '/',
component: Home,
},
],
});
}
Then create a plugin to use Ionic:
plugins/ionic.js
import Vue from 'vue';
import Ionic from '@ionic/vue';
import '@ionic/core/css/ionic.bundle.css';
Vue.use(Ionic);
& reference it to the nuxt.config.js:
plugins: [
{ src: '~/plugins/ionic.js', mode: 'client' },
]
It must be client-side only, as Ionic is defining custom elements to the DOM: