소스 검색

type:解决类型问题

奔跑的面条 3 년 전
부모
커밋
a43d5778cb
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      src/components/Pages/ChartItemSetting/StylesSetting.vue
  2. 1 1
      src/views/preview/utils/style.ts

+ 1 - 1
src/components/Pages/ChartItemSetting/StylesSetting.vue

@@ -82,7 +82,7 @@ import {
 
 const props = defineProps({
   chartStyles: {
-    type: Object as PropType<PickCreateComponentType<'styles'>>,
+    type: Object as PropType<Omit<PickCreateComponentType<'styles'>, 'animations'>>,
     required: true,
   },
 })

+ 1 - 1
src/views/preview/utils/style.ts

@@ -32,7 +32,7 @@ export const getEditCanvasConfigStyle = (canvas: EditCanvasConfigType) => {
         background: `url(${canvas.backgroundImage}) no-repeat center/100% !important`
       }
   return {
-    position: 'relative',
+    position: 'relative' as const,
     width: canvas.width ? `${canvas.width || 100}px` : '100%',
     height: canvas.height ? `${canvas.height}px` : '100%',
     ...computedBackground