开发组件bug

This commit is contained in:
851673013@qq.com 2022-07-01 15:53:16 +08:00
parent cacb9ec52e
commit d347e274c5
3 changed files with 18 additions and 3 deletions

View File

@ -12,6 +12,7 @@
<!-- 导航 --> <!-- 导航 -->
<developer-navigation <developer-navigation
:dataList="dataList.data" :dataList="dataList.data"
:associatedComponents="associatedComponents"
:class="{ fixed: scrollTop >= 600 }" :class="{ fixed: scrollTop >= 600 }"
:selectNow="selectNow" :selectNow="selectNow"
></developer-navigation> ></developer-navigation>

View File

@ -41,9 +41,10 @@
}, },
}) })
} }
if (props.associatedComponents) { if (props.associatedComponents[0].dataList.length != 0) {
flag.value = true flag.value = true
dataFrom.value = props.associatedComponents dataFrom.value = props.associatedComponents
debugger
console.log('dataFrom.value', dataFrom.value) console.log('dataFrom.value', dataFrom.value)
} else { } else {
flag.value = false flag.value = false

View File

@ -60,6 +60,7 @@
const props = defineProps({ const props = defineProps({
selectNow: { type: String, default: '' }, selectNow: { type: String, default: '' },
dataList: { type: Object, default: null }, dataList: { type: Object, default: null },
associatedComponents: { type: Array, default: null },
}) })
const select = ref('algorithm-display') const select = ref('algorithm-display')
const list = ref([]) const list = ref([])
@ -84,7 +85,13 @@
navList.value.forEach((item) => { navList.value.forEach((item) => {
console.log(item) console.log(item)
if (list.value.indexOf(item.name) > -1) { if (list.value.indexOf(item.name) > -1) {
item.show = true if (item.name == '关联能力') {
if (props.associatedComponents[0].dataList.length != 0) {
item.show = true
}
} else {
item.show = true
}
} }
}) })
select.value = navList.value.filter( select.value = navList.value.filter(
@ -121,7 +128,13 @@
navList.value.forEach((item) => { navList.value.forEach((item) => {
console.log(item) console.log(item)
if (list.value.indexOf(item.name) > -1) { if (list.value.indexOf(item.name) > -1) {
item.show = true if (item.name == '关联能力') {
if (props.associatedComponents[0].dataList.length != 0) {
item.show = true
}
} else {
item.show = true
}
} }
}) })
if (list.value.length > 0) { if (list.value.length > 0) {