I have a VueJS project where I want to hide a component (Navigation Drawer) on the login page.
It's working but I have an error and I can't build my app.
I'm using vue router by the way.
My component is splitted in 3 files (.vue, .html, .ts)
He is my .ts file with the error :
Do someone have any idea how can I still hide my component on the login page without the error so I can build my app ?
Thank you !
Here is my NavigationDrawer.ts file :
import Vue from 'vue'
export default Vue.extend({
name: "NavigationDrawer",
data: () => ({
items: [
{ title: 'Accueil', icon: 'mdi-home-city', link: '/index' },
{ title: 'Magasins', icon: 'mdi-file-table-box-outline', link: '/magasins' },
{ title: 'Page 2', icon: 'mdi-file-table-box-multiple-outline', link: '/page2' },
{ title: 'Paramètres', icon: 'mdi-cog-outline', link: '/settings' },
],
}),
computed: {
isLogin() {
return !['Login'].includes(this.$route.name)
}
}
})
Antoine
question from:
https://stackoverflow.com/questions/65886746/vuejs-ts-error-on-hiding-a-component-on-specific-page 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…