fixed #718
This commit is contained in:
parent
59e1a7c6c1
commit
83b7388598
4 changed files with 15 additions and 44 deletions
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div style="width: 400px;margin: 200px;">
|
||||||
<Collapse v-model="v1" accordion>
|
<Collapse v-model="v1" accordion>
|
||||||
<Panel name="1">
|
<Panel name="1">
|
||||||
史蒂夫·乔布斯
|
史蒂夫·乔布斯
|
||||||
|
|
|
@ -1,50 +1,18 @@
|
||||||
<template>
|
<template>
|
||||||
<Row>
|
<Select v-model="fields.pid" filterable>
|
||||||
<i-col span="12" style="padding-right:10px">
|
<Option :value="0" label="一级菜单"></Option>
|
||||||
<Select v-model="model11" filterable>
|
<Option :value="1" label="二级菜单"></Option>
|
||||||
<Option v-for="item in cityList" :value="item.value" :key="item">{{ item.label }}</Option>
|
</Select>
|
||||||
</Select>
|
|
||||||
</i-col>
|
|
||||||
<i-col span="12">
|
|
||||||
<Select v-model="model12" filterable multiple>
|
|
||||||
<Option v-for="item in cityList" :value="item.value" :key="item">{{ item.label }}</Option>
|
|
||||||
</Select>
|
|
||||||
</i-col>
|
|
||||||
</Row>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
cityList: [
|
fields: {
|
||||||
{
|
pid: 0
|
||||||
value: 'beijing',
|
}
|
||||||
label: '北京市'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 'shanghai',
|
|
||||||
label: '上海市'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 'shenzhen',
|
|
||||||
label: '深圳市'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 'hangzhou',
|
|
||||||
label: '杭州市'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 'nanjing',
|
|
||||||
label: '南京市'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 'chongqing',
|
|
||||||
label: '重庆市'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
model11: '',
|
|
||||||
model12: []
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
|
@ -56,7 +56,7 @@
|
||||||
handleTriggerItem (item, fromInit = false) {
|
handleTriggerItem (item, fromInit = false) {
|
||||||
if (item.disabled) return;
|
if (item.disabled) return;
|
||||||
|
|
||||||
// return value back recursion
|
// return value back recursion // 向上递归,设置临时选中值(并非真实选中)
|
||||||
const backItem = this.getBaseItem(item);
|
const backItem = this.getBaseItem(item);
|
||||||
this.tmpItem = backItem;
|
this.tmpItem = backItem;
|
||||||
this.emitUpdate([backItem]);
|
this.emitUpdate([backItem]);
|
||||||
|
|
|
@ -493,7 +493,7 @@
|
||||||
this.query = query;
|
this.query = query;
|
||||||
},
|
},
|
||||||
modelToQuery() {
|
modelToQuery() {
|
||||||
if (!this.multiple && this.filterable && this.model) {
|
if (!this.multiple && this.filterable && this.model !== undefined) {
|
||||||
this.findChild((child) => {
|
this.findChild((child) => {
|
||||||
if (this.model === child.value) {
|
if (this.model === child.value) {
|
||||||
if (child.label) {
|
if (child.label) {
|
||||||
|
@ -518,6 +518,9 @@
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
this.modelToQuery();
|
this.modelToQuery();
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.broadcastQuery('');
|
||||||
|
});
|
||||||
|
|
||||||
this.updateOptions(true);
|
this.updateOptions(true);
|
||||||
document.addEventListener('keydown', this.handleKeydown);
|
document.addEventListener('keydown', this.handleKeydown);
|
||||||
|
|
Loading…
Add table
Reference in a new issue