| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <template>
- <div>
- <el-select v-model="select_val" @change="handleChange" placeholder="请选择">
- <el-option
- v-for="item in options"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- </div>
- </template>
- <script>
- export default {
- props: {
- value: {
- type: String
- },
- type: {
- type: String
- },
- },
- data() {
- return {
- select_val: [],
- type_val:"",
- options: []
- }
- },
- watch:{
- value:function (newVal,oldVal) {
- this.select_val = newVal+"";
- },
- type:function (newVal,oldVal) {
- this.type_val = newVal+"";
- this.select_val = "";
- this.getCateGory()
- }
- },
- mounted() {
- this.getCateGory();
- },
- methods: {
- handleChange(value) {
- this.select_val = value+"";
- this.$emit('input',value)
- },
- async getCateGory() {
- const res = await this.$post('/uapi/pub/list/admin/category/get_cate_parent',{type:this.type_val})
- this.options = res.data;
- this.select_val = this.value+"";
- }
- }
- }
- </script>
- <style scoped>
- .screenfull-svg {
- display: inline-block;
- cursor: pointer;
- fill: #5a5e66;;
- width: 20px;
- height: 20px;
- vertical-align: 10px;
- }
- </style>
|