2021-11-15 10:25:50 +00:00
|
|
|
export * from 'vue'
|
|
|
|
|
|
|
|
export const install = () => {}
|
|
|
|
|
2022-08-12 17:47:58 +00:00
|
|
|
export function set (target: any, key: string | number | symbol, val: any) {
|
2021-11-15 10:25:50 +00:00
|
|
|
if (Array.isArray(target)) {
|
2022-08-12 17:47:58 +00:00
|
|
|
target.length = Math.max(target.length, key as number)
|
|
|
|
target.splice(key as number, 1, val)
|
2021-11-15 10:25:50 +00:00
|
|
|
return val
|
|
|
|
}
|
|
|
|
target[key] = val
|
|
|
|
return val
|
|
|
|
}
|
|
|
|
|
2022-08-12 17:47:58 +00:00
|
|
|
export function del (target: any, key: string | number | symbol) {
|
2021-11-15 10:25:50 +00:00
|
|
|
if (Array.isArray(target)) {
|
2022-08-12 17:47:58 +00:00
|
|
|
target.splice(key as number, 1)
|
2021-11-15 10:25:50 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
delete target[key]
|
|
|
|
}
|