fix(views/dict): tag的type类型使用错误警告修复

This commit is contained in:
郝先瑞
2022-01-01 16:12:24 +08:00
parent 2bedf0c553
commit 416b94b85c

View File

@@ -17,7 +17,7 @@
<template #header> <template #header>
<svg-icon color="#333" icon-class="dict"/> <svg-icon color="#333" icon-class="dict"/>
<span style="margin:0 5px;">字典数据项</span> <span style="margin:0 5px;">字典数据项</span>
<el-tag type="primary" v-if=" state.dictCode" size="small">{{ state.dictName }}</el-tag> <el-tag type="success" v-if=" state.dictCode" size="small">{{ state.dictName }}</el-tag>
<el-tag type="warning" v-else size="small">未选择字典</el-tag> <el-tag type="warning" v-else size="small">未选择字典</el-tag>
</template> </template>
<!-- 字典项组件 --> <!-- 字典项组件 -->
@@ -33,13 +33,15 @@ import SvgIcon from '@/components/SvgIcon/index.vue';
import Dict from './components/Dict.vue' import Dict from './components/Dict.vue'
import DictItem from './components/DictItem.vue' import DictItem from './components/DictItem.vue'
import {reactive} from 'vue' import {reactive,toRefs} from 'vue'
const state = reactive({ const state = reactive({
dictCode: '', dictCode: '',
dictName: '' // 字典名称,用于字典项组件回显 dictName: '' // 字典名称,用于字典项组件回显
}) })
const {dictCode,dictName} =toRefs(state)
const handleDictClick = (dictRow: any) => { const handleDictClick = (dictRow: any) => {
if (dictRow) { if (dictRow) {
state.dictName = dictRow.name state.dictName = dictRow.name