vue3用element的table组件
<el-table-column prop="status" label="状态" align="center">
<template #default="scope">
<el-tag
:type="scope.row.status ? 'success' : 'danger'"
class="mx-1"
effect="dark"
>
{{ scope.row.status ? "启用" : "禁用" }}
</el-tag>
</template>
</el-table-column>
scope的类型如何定义,status万一拼错了,也发现不了,很尴尬
模板里面做类型断言
{{ (scope.row as Info).status }}