mirror of
https://gitee.com/dromara/go-view.git
synced 2026-04-23 00:00:12 +08:00
fix: 新增右键和删除功能
This commit is contained in:
@@ -52,7 +52,11 @@ export const useChartEditStoreStore = defineStore({
|
||||
this.componentList.push(chartData)
|
||||
},
|
||||
// * 删除组件列表
|
||||
removeComponentList<T extends { key: string }>(chartData: T): void {
|
||||
removeComponentList<T extends { key: string }>(chartData: T | number): void {
|
||||
if(typeof chartData === 'number') {
|
||||
this.componentList.splice(chartData, 1)
|
||||
return
|
||||
}
|
||||
const i = this.componentList.findIndex(e => e.key === chartData.key)
|
||||
if (i !== -1) {
|
||||
this.componentList.splice(i, 1)
|
||||
|
||||
Reference in New Issue
Block a user