|
|
@@ -5,7 +5,10 @@
|
|
|
<p>组件目录</p>
|
|
|
</div>
|
|
|
<div class="ztree-container">
|
|
|
- <p v-for="(i, k) in menu" :key="k" @click="scrollToSection(k)">{{ k }}({{ i.length }})</p>
|
|
|
+ <p v-for="(i, k, index) in menu" :key="index" @click="scrollToSection(k, index)"
|
|
|
+ :class="[`${action == index ? 'action' : ''}`]">{{ k
|
|
|
+ }}({{
|
|
|
+ i.length }})</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="datacenter-right">
|
|
|
@@ -30,6 +33,7 @@ export default defineComponent({
|
|
|
setup() {
|
|
|
var menu = ref({});
|
|
|
var assemblylist = ref([]);
|
|
|
+ const action = ref(0)
|
|
|
onMounted(() => {
|
|
|
list().then(res => {
|
|
|
if (res && res.length) {
|
|
|
@@ -39,17 +43,20 @@ export default defineComponent({
|
|
|
if (i.source) menu.value[i.source].push(i), list.push(i);
|
|
|
})
|
|
|
// eventBus.emit('assemblylist', list)
|
|
|
+ console.log(menu.value)
|
|
|
eventBus.emit('assemblylist', menu.value)
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
|
|
|
- function scrollToSection(id) {
|
|
|
+ function scrollToSection(id, index) {
|
|
|
+ action.value = index;
|
|
|
var dom = document.getElementById(id);
|
|
|
if (dom) dom.scrollIntoView({ behavior: 'smooth' });
|
|
|
}
|
|
|
|
|
|
return {
|
|
|
+ action,
|
|
|
scrollToSection,
|
|
|
menu,
|
|
|
assemblylist,
|
|
|
@@ -59,6 +66,11 @@ export default defineComponent({
|
|
|
});
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
|
+.ztree-container p.action {
|
|
|
+ background: #0671DD;
|
|
|
+ color: #fff;
|
|
|
+}
|
|
|
+
|
|
|
.account-center-bottom {
|
|
|
background: #fff;
|
|
|
height: calc(100vh - 110px);
|