84669 人学习
152542 人学习
20005 人学习
5487 人学习
7821 人学习
359900 人学习
3350 人学习
180660 人学习
48569 人学习
18603 人学习
40936 人学习
1549 人学习
1183 人学习
32909 人学习
Vue.component(name,obj);我看vue官网上市这样写的Vue.component('my-component', { template: '<p>A custom component!</p>'})注册一个全局的模板,<my-component><my-component>
能不能不直接在template写代码,而是引用写好的.vue文件。做my-component的template??? 能的话 要怎么写???
1.官网上的代码使用于前端非工程化开发中,比较简单的模式
2.进阶的话,也就是使用vue文件,进行编译咯哟。更多参考vue-cli 生成的 template
import Hello from "./hello.vue";
hello.vue
<template> <p></p> </template> <script></script>
1.官网上的代码使用于前端非工程化开发中,比较简单的模式
2.进阶的话,也就是使用vue文件,进行编译咯哟。更多参考vue-cli 生成的 template
hello.vue