javascript - Vue.component problem, please help to answer~
给我你的怀抱
给我你的怀抱 2017-05-31 10:41:32
0
1
670

Vue.component(name,obj);
I saw it written like this on the vue official website
Vue.component('my-component', {
template: '<p>A custom component !</p>'
})
Register a global template, <my-component><my-component>

Can I not write the code directly in the template?
Instead, reference the written .vue file. Make a template for my-component? ? ? If so, how should I write it? ? ?

给我你的怀抱
给我你的怀抱

reply all(1)
漂亮男人

1. The code on the official website is used in front-end non-engineering development, which is a relatively simple model

2. If you want to advance, you can use vue files to compile. For more reference, please refer to the template generated by vue-cli

import Hello from "./hello.vue";

hello.vue

<template>
<p></p>
</template>
<script></script>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template