<template slot-scope="scope" v-if="item.prop === 'scope.row.mg_state'"> <el-switch v-model="item.prop" /> </template>
时间: 2024-05-21 19:11:07 浏览: 143
v-slot和slot、slot-scope之间相互替换实例
This is a Vue.js template that uses a slot-scope to access the properties of a row in a table. The template conditionally renders an el-switch component based on the value of a property called "mg_state" in the row object. If the property exists, the el-switch component is rendered and bound to the value of the "prop" property.
阅读全文