revert visible
This commit is contained in:
parent
21166d0326
commit
8872674ba6
|
@ -4,12 +4,14 @@ type state = {
|
|||
name?: string,
|
||||
description?: string,
|
||||
clickable: PromoScene[],
|
||||
_visible: { id: number, is_enabled: boolean }[],
|
||||
visible: PromoScene[],
|
||||
}
|
||||
export const usePromoScene = defineStore('promo_scene', {
|
||||
state: () => {
|
||||
return {
|
||||
clickable: [],
|
||||
_visible: [],
|
||||
visible: [],
|
||||
} as state
|
||||
},
|
||||
|
@ -22,7 +24,10 @@ export const usePromoScene = defineStore('promo_scene', {
|
|||
this.clickable = data
|
||||
},
|
||||
setVisible(data: PromoScene[]) {
|
||||
this.visible = data
|
||||
this._visible = data.slice(0).map(el => {
|
||||
return { id: el.id, is_enabled: el.is_enabled ?? true }
|
||||
})
|
||||
this.visible = data.slice(0)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { defineStore } from 'pinia'
|
||||
import { useClickable } from './clickable'
|
||||
import { usePromoScene } from './promo_scene'
|
||||
|
||||
export const usePromoSidebar = defineStore('promo_sidebar', {
|
||||
state: () => {
|
||||
|
@ -47,13 +48,18 @@ export const usePromoSidebar = defineStore('promo_sidebar', {
|
|||
// this.target = undefined;
|
||||
// this.loading = true;
|
||||
this.is_open = false;
|
||||
this.accordions = []
|
||||
this.accordions = [];
|
||||
}
|
||||
},
|
||||
closeBtn() {
|
||||
this.$reset;
|
||||
this.is_open = false;
|
||||
this.is_btn_open = false;
|
||||
|
||||
const sidebar_scene = usePromoScene()
|
||||
sidebar_scene.visible.map(el => {
|
||||
el.is_enabled = (sidebar_scene._visible.find(item => item.id == el.id) ?? { is_enabled: true }).is_enabled
|
||||
})
|
||||
},
|
||||
toggleAccordion(name: string, newState = null) {
|
||||
if (name == 'obj' && this.accordions.includes('clickable')) this.toggleAccordion('clickable')
|
||||
|
|
Loading…
Reference in New Issue