设置组件中的内容
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="./vue.js"></script>
</head>
<body>
<div id="app">
<table>
<tbody>
<!-- 约定俗成的目录体系可以用is 来调用真正的组件嵌套到里面 -->
<tr is="row"></tr is="row">
<tr is="row"></tr is="row">
</tbody>
</table>
</div>
<script>
/*组件中的值需要用函数表示*/
Vue.component('row',{
data:function(){
return {content:'uuu'}
},
template:'<tr><td>{{content}}</td></tr>'
})
var vm = new Vue({
el:"#app",
})
</script>
</body>
</html>
组件内容设置