vue学习(五)-vue2.0
组件模板的变化
// 1.0时候的试用方法
<template>
<h3>我是组件</h3>
<strong>我是加粗标签</strong>
</template>
// 2.0时候的使用方法 必须要有一个根标签包裹着,否则出错
<template id="aaa">
<div>
<h3>我是组件</h3>
<strong>我是加粗标签</strong>
</div>
</template>
组件模板的使用发生了变化,2.0之使用组件必须要有跟标签包裹着
具体示例代码如下:
// 1.0做法
<div id="box">
<module></module>
</div>
<template id="bbb">
<h1>模板1!{
{
msg}}</