错误:

<template slot-scope="scope">   <!-- 取值必须用slot-scope -->
	<i class="scope.row.isWork === '是' ? 'el-icon-circle-check' : 'el-icon-circle-close'"></i>
</template>

正确:i class之间加冒号

   <template slot-scope="scope">   <!-- 取值必须用slot-scope -->
    	<i :class="scope.row.isWork === '是' ? 'el-icon-circle-check' : 'el-icon-circle-close'"></i>
   </template>

错误:

<template slot-scope="props">
    <el-form label-position="left" inline class="demo-table-expand">
         <el-radio  v-model="radio" label="props.row.sex">男</el-radio>
         <el-radio  v-model="radio" label="props.row.sex">女</el-radio>
    </el-form>
</template>

正确:"radio"label之间加冒号

<template slot-scope="props">
    <el-form label-position="left" inline class="demo-table-expand">
             <el-radio  v-model="radio" :label="props.row.sex">男</el-radio>
             <el-radio  v-model="radio" :label="props.row.sex">女</el-radio>
    </el-form>
</template>

总结:用到slot-scope取值时,取值表达式xxx.row.yyy项前面都应该加冒号

Logo

前往低代码交流专区

更多推荐