uniapp插件自定和化
发布时间
阅读量:
阅读量

必须使用slot插槽
任何自定义组件都必须包含至少一个插槽才能正常运行 当仅包含一个插槽时 该插槽必须位于顶层视图中才能确保功能正常 若需要构建具有复杂层级结构的插槽 则必须采用命名插槽以实现精确定位
具名插槽
在自定义组件中配置name属性设为"插槽名";在调用时应当采用template v-slot:插槽名的时序。
<template v-slot:header>
<view>Here might be a page title</view>
</template>
<template v-slot:default>
<view>A paragraph for the main content.</view>
<view>And another one.</view>
</template>
全部评论 (0)
还没有任何评论哟~
