slot | 用于设置标签的属性值(slot="title") |
---|---|
slot-scope | |
v-slot | |
slot
javascript
<el-menu-item v-if="!navMenu.children" :key="navMenu.id" :index="navMenu.id + ''" @click="itemClick(navMenu)" >
<span slot="title">{{ navMenu.name }}</span>
</el-menu-item>
javascript
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="save">确 定</el-button>
</span>
slot-scope
javascript
<el-table-column label="修改时间" width='150' align='center'>
<template slot-scope="scope">{{scope.row.modifyTime|formtterDate}}</template>
</el-table-column>
v-slot
javascript
<Test>
<template v-slot:header="scope">//v-slot定义作用域插槽
<div>
<p> {{scope.msg}} </p>
</div>
</template>
</Test>