fix: 修复table组件id、ref命名未声明index导致的报警问题

This commit is contained in:
刘洪洪
2022-12-14 18:07:48 +08:00
parent fce1c27cf8
commit 195404cd50
6 changed files with 11 additions and 10 deletions

View File

@@ -44,8 +44,8 @@
</div> </div>
</div> </div>
<el-table <el-table
:id="`tabTable_${index}`" id="tabTable"
:ref="`dataTable_${index}`" ref="dataTable"
:data="tableData" :data="tableData"
class="npm-app-event-table dns-recent-event-table" class="npm-app-event-table dns-recent-event-table"
height="100%" height="100%"

View File

@@ -51,7 +51,7 @@ export default {
}, },
setup () { setup () {
const { query } = useRoute() const { query } = useRoute()
const tab = ref(query.tabIndex || 0) const tab = ref(query.tabIndex || '0')
const queryCondition = ref(query.queryCondition || '') const queryCondition = ref(query.queryCondition || '')
return { return {
tab, tab,
@@ -422,7 +422,7 @@ export default {
}) })
}, },
resize () { resize () {
if (this.tab === 0) { if (this.tab === '0') {
this.myChart.resize() this.myChart.resize()
} else { } else {
this.myChart2.resize() this.myChart2.resize()

View File

@@ -17,8 +17,8 @@
</div> </div>
</div> </div>
<el-table <el-table
:id="`tabTable_${index}`" id="tabTable"
:ref="`dataTable_${index}`" ref="dataTable"
:data="tableData" :data="tableData"
class="app-table" class="app-table"
height="100%" height="100%"

View File

@@ -20,8 +20,8 @@
<span>{{ $t('network.metric') }}</span> <span>{{ $t('network.metric') }}</span>
</div> </div>
<el-table <el-table
:id="`tabTable_${index}`" id="tabTable"
:ref="`dataTable_${index}`" ref="dataTable"
:data="tableData" :data="tableData"
class="npm-app-event-table" class="npm-app-event-table"
height="100%" height="100%"

View File

@@ -5,8 +5,8 @@
<chart-error v-if="showError" tooltip :content="errorMsg" /> <chart-error v-if="showError" tooltip :content="errorMsg" />
</div> </div>
<el-table <el-table
:id="`tabTable_${index}`" id="tabTable"
:ref="`dataTable_${index}`" ref="dataTable"
:data="tableData" :data="tableData"
class="npm-recent-table" class="npm-recent-table"
:class="{'npm-recent-table-ten': tableData.length === 10}" :class="{'npm-recent-table-ten': tableData.length === 10}"

View File

@@ -46,6 +46,7 @@ export default {
tabs tabs
} }
}, },
emits: ['tabChange'],
watch: { watch: {
currentTab (n) { currentTab (n) {
const { query } = this.$route const { query } = this.$route