提交 005d8efe 编写于 作者: Neuromancer255's avatar Neuromancer255

多数据视图快速分组组件 --fix5

上级 f8cd1d50
<template> <template>
<div> <div>
<div class="app-quick-group"> <div class="app-quick-group">
<div :class="{'quick-group-tab':true,'app-seleted-item':isSelectedItem(item)}" v-for="(item,index) in showItems" :key="index"> <div :class="{'quick-group-tab':true,'app-seleted-item':isSelectedItem(item) || item.childSelect}" v-for="(item,index) in showItems" :key="index">
<div <div
:style="{color:item.color}" :style="{color:item.color}"
@click="handleClick(item)" @click="handleClick(item)"
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</div> </div>
</div> </div>
</div> </div>
<div ref="child-list" v-if="subItems.length > 0" class="child-list"> <div ref="child-list" v-if="subItems.length > 0" :class="{'child-list':true,}">
<div :class="{'child':true,'selected':item.selected}" v-for="(item,index) in subItems" :key="index" @click="handleClick(item)"> <div :class="{'child':true,'selected':item.selected}" v-for="(item,index) in subItems" :key="index" @click="handleClick(item)">
<span> <span>
<ion-icon v-if=" item.iconcls && !Object.is(item.iconcls, '')" :name="item.iconcls"></ion-icon> <ion-icon v-if=" item.iconcls && !Object.is(item.iconcls, '')" :name="item.iconcls"></ion-icon>
...@@ -174,8 +174,14 @@ export default class AppQuickGroupTab extends Vue { ...@@ -174,8 +174,14 @@ export default class AppQuickGroupTab extends Vue {
this.subItems.length = 0; this.subItems.length = 0;
this.items.forEach((item:any) => { this.items.forEach((item:any) => {
item.selected = false; item.selected = false;
item.childSelect = false;
}) })
$event.selected = true; $event.selected = true;
this.items.forEach((item:any) => {
if (item.id === $event.pvalue) {
item.childSelect = true;
}
})
this.$emit("valuechange", $event); this.$emit("valuechange", $event);
} }
this.$forceUpdate(); this.$forceUpdate();
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册