提交 9647c791 编写于 作者: RedPig97's avatar RedPig97

update: 搜索栏更新

上级 7c25628b
<template>
<div class="app-searchbar">
<div class="app-searchbar-group" v-for="(item,index) in condItems">
<div class="app-searchbar-group" v-for="(item,index) in items">
<el-select size="small" class="app-searchbar-field app-searchbar-item" v-model="item.field" clearable :placeholder="$t('components.filterTree.placeholder')">
<el-option
v-for="field in fieldItems"
......@@ -16,7 +16,7 @@
<slot :data="item"></slot>
</div>
<div class="app-searchbar-action">
<img v-if="index === condItems.length - 1" src="assets/img/ic_add_circle.svg" @click="onAddItem()">
<img v-if="index === items.length - 1" src="assets/img/ic_add_circle.svg" @click="onAddItem()">
<img v-else src="assets/img/remove_circle.svg" @click="onRemoveItem(index)">
</div>
</div>
......@@ -51,20 +51,6 @@ export default class AppSearchbar extends Vue {
*/
@Prop() fields: any;
@Watch("items", {immediate: true})
onItemsChange(newItems: any[]) {
this.condItems = [];
if (newItems && newItems.length > 0) {
this.condItems.push(...newItems);
} else {
this.condItems.push({
field: null,
mode: null,
editor: null
});
}
}
/**
* 属性项集合
*
......@@ -73,14 +59,6 @@ export default class AppSearchbar extends Vue {
*/
protected fieldItems: any[] = [];