Commit 4b2f2e04aacd6d5a225a08356c18b5d25e423652
1 parent
aff15756
fix(background): 修复背景图片在预览模式下引用路径不正确
Showing
2 changed files
with
6 additions
and
1 deletions
... | ... | @@ -177,6 +177,7 @@ const rangeStyle = computed(() => { |
177 | 177 | // : { background: `url(${backgroundImage}) no-repeat center center / cover !important` } |
178 | 178 | // THINGS_KIT 路径转换,同步生产环境与开发环境的保存的静态资源文件路径不一致 |
179 | 179 | : { background: `url(${getBackgroundImagePath(backgroundImage!)}) no-repeat center center / cover !important` } |
180 | + console.log(getBackgroundImagePath(backgroundImage!)) | |
180 | 181 | return { |
181 | 182 | ...computedBackground, |
182 | 183 | width: 'inherit', | ... | ... |
1 | 1 | import { PickCreateComponentType } from '@/packages/index.d' |
2 | 2 | import { EditCanvasConfigType } from '@/store/modules/chartEditStore/chartEditStore.d' |
3 | +/// THINGS_KIT 修改背景图片 | |
4 | +import { useBackgroundSelect } from '@/utils/external/useBackgroundImageSelect' | |
3 | 5 | |
4 | 6 | type AttrType = PickCreateComponentType<'attr'> |
5 | 7 | type StatusType = PickCreateComponentType<'status'> |
... | ... | @@ -41,13 +43,15 @@ export const getPreviewConfigStyle = (previewConfig: PreviewConfig) => { |
41 | 43 | return previewStyle |
42 | 44 | } |
43 | 45 | |
46 | +// THINGS_KIT 修改背景图片 | |
47 | +const { getBackgroundImagePath } = useBackgroundSelect() | |
44 | 48 | // 全局样式 |
45 | 49 | export const getEditCanvasConfigStyle = (canvas: EditCanvasConfigType) => { |
46 | 50 | // 背景 |
47 | 51 | const computedBackground = canvas.selectColor |
48 | 52 | ? { background: canvas.background } |
49 | 53 | : { |
50 | - background: `url(${canvas.backgroundImage}) center center / cover no-repeat !important` | |
54 | + background: `url(${getBackgroundImagePath(canvas.backgroundImage as unknown as string)}) center center / cover no-repeat !important` | |
51 | 55 | } |
52 | 56 | return { |
53 | 57 | position: 'relative' as const, | ... | ... |