mirror of
https://github.com/palxiao/poster-design.git
synced 2025-07-15 16:02:19 +08:00
code: optimize panel
This commit is contained in:
parent
3615a040f0
commit
e585781c34
@ -38,21 +38,15 @@ export default {
|
|||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
widgetClassifyList: widgetClassifyListData,
|
widgetClassifyList: widgetClassifyListData,
|
||||||
activeWidgetClassify: -1,
|
activeWidgetClassify: 0,
|
||||||
active: true,
|
active: true,
|
||||||
})
|
})
|
||||||
const clickClassify = (index: number) => {
|
const clickClassify = (index: number) => {
|
||||||
state.activeWidgetClassify = index
|
state.activeWidgetClassify = index
|
||||||
state.active = true
|
state.active = true
|
||||||
}
|
}
|
||||||
const getStyle = (index: number) => {
|
|
||||||
return {
|
|
||||||
display: state.activeWidgetClassify === index ? '' : 'none',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
state.activeWidgetClassify = 0
|
|
||||||
await nextTick()
|
await nextTick()
|
||||||
const { koutu } = route.query
|
const { koutu } = route.query
|
||||||
koutu && (state.activeWidgetClassify = 5)
|
koutu && (state.activeWidgetClassify = 5)
|
||||||
@ -82,7 +76,6 @@ export default {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
clickClassify,
|
clickClassify,
|
||||||
getStyle,
|
|
||||||
...toRefs(state),
|
...toRefs(state),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user