123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <template>
- <el-select
- v-model="selected"
- class="size-select"
- placeholder="请选择"
- @change="select"
- :style="styles"
- clearable
- >
- <el-option
- v-for="item in optionList"
- :key="item.code"
- :label="item.name"
- :value="item.code"
- >
- <span>{{ item.name }}</span>
- </el-option>
- </el-select>
- </template>
- <script>
- import { LEVEL_TYPE_SELECT } from "@/constants/constants";
- export default {
- name: "ExamTypeSelect",
- props: {
- value: {
- type: String,
- default: ""
- },
- options: { type: Array, default: () => null },
- styles: { type: String }
- },
- data() {
- return {
- optionList: this.options || LEVEL_TYPE_SELECT,
- selected: ""
- };
- },
- async created() {},
- watch: {
- value: {
- immediate: true,
- handler(val) {
- this.selected = val;
- }
- }
- },
- methods: {
- select() {
- this.$emit("input", this.selected);
- this.$emit("change", this.selected);
- }
- }
- };
- </script>
- <style></style>
|