feat(dict.ts):添加字典接口和移除全局获取字典项的ts警告;

This commit is contained in:
有来技术
2021-12-08 00:18:45 +08:00
parent 2aee00631e
commit 338f3c59ce
5 changed files with 423 additions and 16 deletions

View File

@@ -0,0 +1,56 @@
<template>
<div class="app-container">
<el-row :gutter="10">
<el-col :span="12" :xs="24">
<el-card class="box-card">
<div class="clearfix" slot="header">
<span>字典列表</span>
</div>
<!-- 字典列表子组件 -->
<dict @dictClick="dictClick" @resetItem="resetItem" ref="dict"></dict>
</el-card>
</el-col>
<el-col :span="12" :xs="24">
<el-card class="box-card">
<div class="clearfix" slot="header">
<span>{{ dict.name }}数据项</span>
</div>
<!-- 字典数据项子组件 -->
<dict-item ref="dictItem"></dict-item>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script>
import Dict from './components/Dict.vue'
import DictItem from './components/DictItem.vue'
export default {
name: "index",
components: {Dict, DictItem},
data() {
return {
dict: {
name: undefined
}
}
},
methods: {
dictClick(row) {
this.dict.name = row.name ? '【' + row.name + '】' : undefined
this.$refs.dictItem.dictClick(row)
},
resetItem() {
this.dict.name = undefined
this.$refs.dictItem.dictClick()
}
}
}
</script>
<style scoped>
</style>