本文主要是介绍vue.js slot-scope 取值,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
错误:
<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项前面都应该加冒号
这篇关于vue.js slot-scope 取值的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!