代码如下:
<body>
<div id="app">
<table>
<tr is="mycomponent"></tr>
<tr>怎么上去了?</tr>
</table>
</div>
<script>
Vue.component('mycomponent',{
template: '<tr>这也是一个自定义组件</tr>'
})
var app = new Vue({
el: '#app',
data: {
}
})
</script>
</body>
渲染结果如下:
按道理说,tr
是可以放在table
中的吧
相关分类