52 lines
912 B
Vue
52 lines
912 B
Vue
<template>
|
|
<el-select v-model="currentOption" placeholder="风险等级" style="width: 100%" @change="handleChange">
|
|
<el-option
|
|
v-for="item in options"
|
|
:key="item.value"
|
|
:label="item.label"
|
|
:value="item.value"
|
|
/>
|
|
</el-select>
|
|
</template>
|
|
|
|
<script>
|
|
|
|
export default {
|
|
name: 'RiskLevelSelect',
|
|
props: ['bindValue', 'disabled'],
|
|
data() {
|
|
return {
|
|
options: []
|
|
}
|
|
},
|
|
computed: {
|
|
currentOption: {
|
|
get() {
|
|
return this.bindValue
|
|
},
|
|
set(val) {
|
|
this.$emit('update:bindValue', val)
|
|
}
|
|
}
|
|
},
|
|
mounted() {
|
|
this.getList()
|
|
},
|
|
methods: {
|
|
getList() {
|
|
this.options = ['一级', '二级', '三级', '四级'].map((item, index) => {
|
|
return {
|
|
value: index,
|
|
label: item
|
|
}
|
|
})
|
|
},
|
|
handleChange(value) {
|
|
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="less"></style>
|