
vue组件
Zhencode
人生没有成败,凡事正面思考
展开
-
component标签使用
<component v-bind:is="who"></component> const coma={ template:`<h1>a</h1>` } const comb={ template:`<h1>b</h1>` } const comc={ template:`<h1&...原创 2019-11-12 17:34:36 · 562 阅读 · 0 评论 -
网页中组件嵌套
const bb={ template:`<h2>子组件模板</h2>` } const aa={ template:`<div><h1>父组件</h1><bb></bb></div>`, components:{ 'bb':bb //父组件声明子组件 ...原创 2019-11-12 17:19:48 · 206 阅读 · 0 评论 -
网页中组件使用prop
<panda here="china"></panda> var vm=new Vue({ el:'#app', components:{ 'panda':{ template:`<div>{{here}}</div>`, props:['here'] //here为属性 } ...原创 2019-11-12 17:08:54 · 208 阅读 · 0 评论