C
C
chelkaz2017-06-19 19:16:37
Vue.js
chelkaz, 2017-06-19 19:16:37

How to render a template in Vue?

The more I delve into, the more misunderstanding ...
For example, why does it not display anything and there are no errors?

import Vue from 'vue'
// В Example.vue есть <template><div>TEST</div></template>
import Example from './components/Example.vue'

new Vue({
    el: '#example',
    components: {Example}
});

Well, in the main page
After npm run dev The page does not display content from Example.vue
But if I specifically change Example.vue to Example12345.vue
Then there is no such thing in the error console.
For example, how to understand where the errors are? In the console, almost with any error, it does not write specifically, but somehow abstractly and cannot be understood.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ilya, 2017-07-08
@hrhr99

1. You didn't output the plugin itself <example></example>
2. Install the VueDevTools plugin for chrome

G
Gennadiy Balachkov, 2017-07-14
@gennadiy403

The component is rendered like this

import Vue from 'vue'
// В Example.vue есть <template><div>TEST</div></template>
import Example from './components/Example.vue'

new Vue({
    el: '#example',
    template: '<Example/>',
    components: {Example}
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question