提交 8d2f5bad 编写于 作者: Neuromancer255's avatar Neuromancer255

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

上级 6b98d134
...@@ -30,8 +30,6 @@ ...@@ -30,8 +30,6 @@
.app-seleted-item { .app-seleted-item {
height: 40px; height: 40px;
height: 40px; height: 40px;
color: red;
border-bottom: 2px solid red;
} }
} }
} }
<template> <template>
<div class="app-quick-group"> <div class="app-quick-group">
<div <div class="quick-group-tab" v-for="(item,index) in showItems" :key="index">
class="quick-group-tab"
v-for="item in showItems"
:key="item.id"
@click="handleClick(item)"
>
<div <div
v-if="!item.children" v-if="!item.children"
:style="{color:item.color}" :style="{color:item.color}"
:class="{'app-seleted-item':isSelectedItem(item)}" :class="{'app-seleted-item':isSelectedItem(item)}"
@click="handleClick(item)"
> >
<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>
<img v-else-if="item.icon && !Object.is(item.icon, '')" :src="item.icon" /> <img v-else-if="item.icon && !Object.is(item.icon, '')" :src="item.icon" />
...@@ -18,9 +14,17 @@ ...@@ -18,9 +14,17 @@
<div class="parentGroup" v-if="item.children"> <div class="parentGroup" v-if="item.children">
<span>{{item.label}}</span> <span>{{item.label}}</span>
<ion-select class="app-quick-item-dropdown" interface="popover" selected-text=" " @ionChange="handleCommand($event,item)"> <ion-select
<ion-select-option v-for="childitem in item.children" :key="childitem.id"> class="app-quick-item-dropdown"
<ion-icon v-if=" childitem.iconcls && !Object.is(childitem.iconcls, '')" :name="childitem.iconcls"></ion-icon> interface="popover"
selected-text=" "
@ionChange="handleCommand($event,item)"
>
<ion-select-option v-for="(childitem,index) in item.children" :key="index">
<ion-icon
v-if=" childitem.iconcls && !Object.is(childitem.iconcls, '')"
:name="childitem.iconcls"
></ion-icon>
<img v-else-if="childitem.icon && !Object.is(childitem.icon, '')" :src="childitem.icon" /> <img v-else-if="childitem.icon && !Object.is(childitem.icon, '')" :src="childitem.icon" />
<span class="app-quick-item-label">{{childitem.label}}</span> <span class="app-quick-item-label">{{childitem.label}}</span>
</ion-select-option> </ion-select-option>
...@@ -43,6 +47,8 @@ import { ...@@ -43,6 +47,8 @@ import {
components: {}, components: {},
}) })
export default class AppQuickGroupTab extends Vue { export default class AppQuickGroupTab extends Vue {
public test($event: any) {}
/** /**
* 快速分组代码表 * 快速分组代码表
* *
...@@ -156,6 +162,7 @@ export default class AppQuickGroupTab extends Vue { ...@@ -156,6 +162,7 @@ export default class AppQuickGroupTab extends Vue {
if (isswitch) { if (isswitch) {
this.selectedUiItem = $event; this.selectedUiItem = $event;
} }
console.log($event);
this.$emit("valuechange", $event); this.$emit("valuechange", $event);
this.$forceUpdate(); this.$forceUpdate();
} }
...@@ -168,11 +175,11 @@ export default class AppQuickGroupTab extends Vue { ...@@ -168,11 +175,11 @@ export default class AppQuickGroupTab extends Vue {
* @memberof AppQuickGroup * @memberof AppQuickGroup
*/ */
public handleCommand($event: any, item: any): void { public handleCommand($event: any, item: any): void {
item.children.forEach((child:any) => { item.children.forEach((child: any) => {
if (child.text === $event.detail.value) { if (child.text === $event.detail.value) {
this.handleClick($event.detail.value, false); this.handleClick(child, true);
} }
}) });
} }
} }
</script> </script>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册