code: optimize panel

This commit is contained in:
ShawnPhang 2023-09-01 16:20:08 +08:00
parent 3615a040f0
commit e585781c34

View File

@ -38,21 +38,15 @@ export default {
const route = useRoute()
const state = reactive({
widgetClassifyList: widgetClassifyListData,
activeWidgetClassify: -1,
activeWidgetClassify: 0,
active: true,
})
const clickClassify = (index: number) => {
state.activeWidgetClassify = index
state.active = true
}
const getStyle = (index: number) => {
return {
display: state.activeWidgetClassify === index ? '' : 'none',
}
}
onMounted(async () => {
state.activeWidgetClassify = 0
await nextTick()
const { koutu } = route.query
koutu && (state.activeWidgetClassify = 5)
@ -82,7 +76,6 @@ export default {
return {
clickClassify,
getStyle,
...toRefs(state),
}
},