vue提示 slot-scope 已弃用 问题
<el-table-column label="订单状态" align="center" prop="orderState" :formatter="orderStateFormat" width="100"><template #default="scope"><el-tag type="success">{{ orderStateFormat(scope.row) }}</el-tag></template></el-table-column><!-- old -->
<children>
<template slot="header">
<h1>Here might be a page title</h1>
</template>
<template slot="default">
<p>A paragraph for the main content.</p>
<p>And another one.</p>
</template>
</children>
<!-- new -->
<children>
<template v-slot:header>
<!-- <template #header> 具名插槽可缩写形式 -->
<h1>Here might be a page title</h1>
</template>
<template v-slot:default>
<p>A paragraph for the main content.</p>
<p>And another one.</p>
</template>
</children>
官方文档里的slot、slot-scope已经弃用
新增了v-slot代替slot
但是v-slot限作用于<template>
旧的使用方法提示已废弃但是编译不报错,在页面中不实现
<!-- old -->
<img slot="item-icon" src="../assets/img/tabbar/home.svg" alt="">
123
新的使用方法
<!-- new -->
<template v-slot:item-icon><img src="../assets/img/tabbar/home.svg" alt=""></template>
<!-- 提供缩写# -->
<template #item-icon><img src="../assets/img/tabbar/home.svg" alt=""></template>
12345
评论
匿名评论
隐私政策
你无需删除空行,直接评论以获取最佳展示效果