代码如下: <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中的吧
添加回答
举报
0/150
提交
取消