fix: 消除编辑时provide警告

This commit is contained in:
xiangmaoshuo
2023-03-16 18:13:48 +08:00
parent 93350f0f6a
commit 2d4bd34e56
2 changed files with 8 additions and 3 deletions
+3 -1
View File
@@ -15,7 +15,9 @@ export const useScale = (localStorageInfo: ChartEditStorageType) => {
provide(SCALE_KEY, scaleRef);
const updateScaleRef = (scale: { width: number; height: number }) => {
scaleRef.value = scale
// 这里需要解构,保证赋值给scaleRef的为一个新对象
// 因为scale始终为同一引用
scaleRef.value = { ...scale }
}
// 屏幕适配