You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
822 B
25 lines
822 B
<template>
|
|
<div>
|
|
<select class="form-control" :name="name" v-valid="valid">
|
|
<option value="">请选择</option>
|
|
<template v-for="item in list">
|
|
<option v-if="item.value===value" :value="item.value" selected>{{item.text}}</option>
|
|
<option v-else :value="item.value">{{item.text}}</option>
|
|
</template>
|
|
</select>
|
|
</div>
|
|
</template>
|
|
<script>
|
|
export default {
|
|
props: ['name', 'value', 'valid', 'data', 'prefix'],
|
|
computed: {
|
|
list: function () {
|
|
var key = this.name;
|
|
if (this.prefix) {
|
|
key = this.name.substring(this.prefix.length + 1);
|
|
}
|
|
return this.data[key + 'SelectList'];
|
|
}
|
|
}
|
|
};
|
|
</script> |