fix: 解决不同route映射同组件时不刷新的问题

This commit is contained in:
chenjinsong
2021-06-15 15:24:36 +08:00
parent 63962e1782
commit bbd8eb2d40
2 changed files with 11 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
<template>
<div>{{panel.name}}</div>
<div>{{panel}}</div>
</template>
<script>
@@ -15,7 +15,10 @@ export default {
}
},
async mounted () {
this.panel = (await getPanelList({ type: this.panelType }))[0]
const panels = await getPanelList({ type: this.panelType })
if (panels && panels.length > 0) {
this.panel = panels[0]
}
},
setup () {
// 取得panel的type