CN-697 feat: npm-tab保留状态
This commit is contained in:
@@ -38,6 +38,8 @@ import _ from 'lodash'
|
||||
import Chart from '@/views/charts2/Chart'
|
||||
import { panelTypeAndRouteMapping, storageKey, drillDownPanelTypeMapping } from '@/utils/constants'
|
||||
import { typeMapping } from '@/views/charts2/chart-tools'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { ref } from 'vue'
|
||||
export default {
|
||||
name: 'ChartList',
|
||||
props: {
|
||||
@@ -52,8 +54,7 @@ export default {
|
||||
return {
|
||||
panelTypeAndRouteMapping,
|
||||
typeMapping,
|
||||
layout: [],
|
||||
npmTabIndex: 0
|
||||
layout: []
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@@ -61,6 +62,14 @@ export default {
|
||||
GridItem: VueGridLayout.GridItem,
|
||||
Chart
|
||||
},
|
||||
setup () {
|
||||
const { query } = useRoute()
|
||||
const tabIndexParam = query.tabIndex
|
||||
const npmTabIndex = ref(tabIndexParam ? parseInt(tabIndexParam) : 0)
|
||||
return {
|
||||
npmTabIndex
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
chartList (n) {
|
||||
if (!_.isEmpty(n)) {
|
||||
|
||||
Reference in New Issue
Block a user