This commit is contained in:
PQZ 2024-08-07 18:16:02 +08:00
parent 14404f023e
commit a271a410e2
2 changed files with 67 additions and 133 deletions

View File

@ -1,12 +1,18 @@
<template>
<div class="block">
<el-cascader v-model="selectedOptions" placeholder="请选择" :options="options" :filter-method="handleFilter"
:debounce="500" :show-all-levels="false" filterable clearable />
<!-- <el-cascader v-model="selectedOptions" placeholder="请选择" :options="options" :filter-method="handleFilter"-->
<!-- :debounce="500" :show-all-levels="false" filterable clearable/>-->
<el-cascader
placeholder="请选择品牌型号"
:options="options"
filterable></el-cascader>
</div>
</template>
<script>
import * as CarBrandSelectorApi from '@/layout/components/CarBrandSelector/Api';
export default {
watch: {
selectedOptions(newVal, oldVal) {
@ -19,11 +25,11 @@ export default {
methods: {
//
handleFilter(node, keyword) {
debugger
console.log(keyword, 'Filtering:');
//
this.getData(keyword);
// this.options =
// const filteredOptions = [
// {
// value: 'filtered1',
@ -50,89 +56,17 @@ export default {
}
CarBrandSelectorApi.searchBrand(param).then(res => {
this.options = res.data
this.options = res.data
});
},
changedOptionsForTest() {
this.options = [{
value: 'zhinan',
label: '指北',
children: [{
value: 'shejiyuanze',
label: '指北1',
children: [{
value: 'yizhi',
label: '一致',
children: [{
value: 'sadme',
label: 'how sad me'
}]
}, {
value: 'fankui',
label: '反馈'
}, {
value: 'xiaolv',
label: '效率'
}, {
value: 'kekong',
label: '可控'
}]
}, {
value: 'daohang',
label: '指北2',
children: [{
value: 'cexiangdaohang',
label: '侧向导航'
}, {
value: 'dingbudaohang',
label: '顶部导航'
}]
}]
},]
},
},
data() {
return {
selectedOptions: [], //
options: [{
value: 'zhinan',
label: '指北',
children: [{
value: 'shejiyuanze',
label: '指北1',
children: [{
value: 'yizhi',
label: '一致',
children: [{
value: 'sadme',
label: 'how sad me'
}]
}, {
value: 'fankui',
label: '反馈'
}, {
value: 'xiaolv',
label: '效率'
}, {
value: 'kekong',
label: '可控'
}]
}, {
value: 'daohang',
label: '指北2',
children: [{
value: 'cexiangdaohang',
label: '侧向导航'
}, {
value: 'dingbudaohang',
label: '顶部导航'
}]
}]
},], //
options: [], //
};
}

View File

@ -71,7 +71,7 @@
<el-button type="primary" @click="submitForm" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</div>
<CarBrandSelector/>
<CarBrandSelector ref="brandForm"/>
</el-dialog>
</div>
</template>