156 Star 1.8K Fork 824

enilu/web-flash

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
index.vue 1.13 KB
一键复制 编辑 原始数据 按行查看 历史
enilu 提交于 2021-07-25 01:24 . Add 工作流模块-代办任务
<template>
<el-select
v-model="dictValue"
style="width: 100%"
:size="size"
:placeholder="placeholder"
@change="change"
>
<el-option
v-for="item in dictList"
:key="item.num"
:label="item.name"
:value="item.num"
/>
</el-select>
</template>
<script>
import dictApi from '@/api/system/dict'
export default {
name: 'DictSelect',
props: {
value: {
type: [String, Number],
default: ''
},
size: {
type: String,
default: 'mini'
},
dictName: {
type: String,
default: '',
require: true
},
placeholder: {
type: String,
default: ''
}
},
data() {
return {
dictList: [],
dictValue: ''
}
},
watch: {
value() {
this.dictValue = this.value + ''
}
},
created() {
this.dictValue = this.value + ''
this.getDictList()
},
methods: {
getDictList() {
// 从后台获取字典列表
dictApi.getDicts(this.dictName).then(response => {
this.dictList = response.data
})
},
change(value) {
this.$emit('input', value)
}
}
}
</script>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/enilu/web-flash.git
git@gitee.com:enilu/web-flash.git
enilu
web-flash
web-flash
master

搜索帮助