visible
This commit is contained in:
parent
3704267de7
commit
86dd4f5cdd
|
@ -175,6 +175,16 @@ const clickEvent = (event: MouseEvent) => {
|
||||||
openSidebar(parseInt(names[0].replace('_clickable', '')))
|
openSidebar(parseInt(names[0].replace('_clickable', '')))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
watch(() => sidebar_scene.list, () => {
|
||||||
|
sidebar_scene.list.forEach(element => {
|
||||||
|
const el = seekByName(scene.value, element.name)
|
||||||
|
if (!el) return
|
||||||
|
if (el.visible !== element.is_enabled) {
|
||||||
|
el.visible = element.is_enabled
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, { deep: true })
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<TresGroup name="loaded">
|
<TresGroup name="loaded">
|
||||||
|
@ -185,7 +195,7 @@ const clickEvent = (event: MouseEvent) => {
|
||||||
</TresGroup>
|
</TresGroup>
|
||||||
</template>
|
</template>
|
||||||
<template v-for="(item, i) in clickable_items">
|
<template v-for="(item, i) in clickable_items">
|
||||||
<TresMesh v-bind="item" :ref="clickable_refs[i]"/>
|
<TresMesh v-bind="item" :ref="clickable_refs[i]" />
|
||||||
</template>
|
</template>
|
||||||
</TresGroup>
|
</TresGroup>
|
||||||
</template>
|
</template>
|
|
@ -6,9 +6,10 @@ import { usePromoSidebar } from '../../stores/promo_sidebar';
|
||||||
import { usePromoScene } from '../../stores/promo_scene';
|
import { usePromoScene } from '../../stores/promo_scene';
|
||||||
|
|
||||||
const sidebar = usePromoSidebar()
|
const sidebar = usePromoSidebar()
|
||||||
const scene = usePromoScene()
|
const sidebar_scene = usePromoScene()
|
||||||
const sidebar_obj = ref()
|
const sidebar_obj = ref()
|
||||||
// onClickOutside(sidebar_obj, () => sidebar.close())
|
// onClickOutside(sidebar_obj, () => sidebar.close())
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div class="sidebar" :class="[{ 'open': sidebar.is_open }]" ref="sidebar_obj">
|
<div class="sidebar" :class="[{ 'open': sidebar.is_open }]" ref="sidebar_obj">
|
||||||
|
@ -27,17 +28,21 @@ const sidebar_obj = ref()
|
||||||
</RouterLink>
|
</RouterLink>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<template v-for="item in scene.list">
|
<span class="sidebar-list-item" v-for="item in sidebar_scene.list">
|
||||||
<h3>{{ item.name }}</h3>
|
<input type="checkbox" v-model="item.is_enabled" :id="item.name" />
|
||||||
<template v-for="p in item.description.split('\n')">
|
<label :for="item.name">
|
||||||
<p>{{ p }}</p>
|
<h3>{{ item.name }}</h3>
|
||||||
</template>
|
<template v-for="p in item.description.split('\n')">
|
||||||
</template>
|
<p>{{ p }}</p>
|
||||||
|
</template>
|
||||||
|
</label>
|
||||||
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|
||||||
.sidebar {
|
.sidebar {
|
||||||
width: 23vw;
|
width: 23vw;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
@ -67,6 +72,14 @@ const sidebar_obj = ref()
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&-list-item {
|
||||||
|
display: flex;
|
||||||
|
label {
|
||||||
|
flex-grow: 1;
|
||||||
|
margin-left: 0.25rem
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 2rem;
|
font-size: 2rem;
|
||||||
|
@ -75,7 +88,7 @@ const sidebar_obj = ref()
|
||||||
|
|
||||||
p,
|
p,
|
||||||
h3 {
|
h3 {
|
||||||
margin: 1rem 0;
|
margin: 0.5rem 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
|
|
Loading…
Reference in New Issue