I'm new to VueJS and would like to add multiple instances of the card component template to the VuetifyJS PWA template. What I tried:
I created a News.vue file with the card template code.
I added a new Vue instance to main.js
new Vue({ el: '#news', router, template: '', components: { News } })
- I added News to index.js:
import Vue from 'vue' import Router from 'vue-router' import Hello from '@/components/Hello' import News from '@/components/News'
Vue.use(Router)
export default new Router({ routes: [ { path: '/', name: 'Hello', component: Hello }, { path: '/', name: 'News', component: News } ] })
Adding <news></news>
multiple times to the Hello.vue template -to show the News.vue template content- didn't work.
What did I do wrong?
Hello.vue code: https://github.com/vuetifyjs/docs/blob/master/examples/layouts/google-contacts.vue
Hello.vue
- webnoob<news></news>
to the Hello.vue template. You've just linked the vuetify code, not your code you've tried it with. - webnoob<news></news>
tags only at the top.<template> <v-app id="inspire"> <news></news> <news></news> <news></news> <v-navigation-drawer fixed clipped app v-model="drawer" > [...]
Everything else is the same code as in the example: github.com/vuetifyjs/docs/blob/master/examples/layouts/… - Tom