vue 的局部组件

来源:互联网 发布:网络大白兔是什么意思 编辑:程序博客网 时间:2024/05/16 18:35
<!DOCTYPE html><html><head><meta charset="UTF-8"><title></title><script type="text/javascript" src="vue1.0.25.js" ></script></head><body><div id="app"><runoob></runoob><my-date></my-date></div><script type="text/javascript">//创建组件构造器let Profile=Vue.extend({template:'<div> <input type="date" name="" id="" value="" /><p>今天已经是冬天了</p></div>'})let Profile2=Vue.extend({template:'<div> <input type="date" name="" id="" value="" /><p>vvvvvvvvvvvvvv</p></div>'})//创建一个全局的组件//    Vue.component('runoob', Profile)new Vue({el:'#app',components:{'my-date':Profile,'runoob':Profile2}})</script></body></html>