由于HTML规范的限制,table表格只能写tr,select只能写option,添加自定义组件可能无效
vue提出的is属性,用于动态组件且基于 DOM 内模板的限制来工作。eg:
<!-- 当 `currentView` 改变时,组件也跟着改变 -->
<component v-bind:is="currentView"></component>
<!-- 这样做是有必要的,因为 `<my-component>` 放在一个`<table>` 内可能无效且被放置到外面 -->
<table>
<tr is="my-component"></tr>
</table>