mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-08-31 19:59:47 +08:00
fix(playground): pc预览适配
This commit is contained in:
parent
0e82f652a9
commit
31d60eb1ba
@ -39,7 +39,8 @@ export default defineComponent({
|
||||
modelValue: {
|
||||
type: Object,
|
||||
default: () => ({
|
||||
width: '375',
|
||||
width: 375,
|
||||
height: 817,
|
||||
}),
|
||||
},
|
||||
},
|
||||
|
@ -33,7 +33,7 @@ export default {
|
||||
top: 0,
|
||||
right: '',
|
||||
bottom: '',
|
||||
width: '375',
|
||||
width: '100%',
|
||||
height: '1728',
|
||||
backgroundImage: '',
|
||||
backgroundColor: 'rgba(248, 218, 218, 1)',
|
||||
|
@ -19,8 +19,14 @@
|
||||
</template>
|
||||
</m-editor>
|
||||
|
||||
<el-dialog v-model="previewVisible" destroy-on-close :width="375" custom-class="pre-viewer" title="预览">
|
||||
<iframe v-if="previewVisible" width="100%" height="817" :src="previewUrl"></iframe>
|
||||
<el-dialog
|
||||
v-model="previewVisible"
|
||||
destroy-on-close
|
||||
custom-class="pre-viewer"
|
||||
title="预览"
|
||||
:width="stageRect && stageRect.width"
|
||||
>
|
||||
<iframe v-if="previewVisible" width="100%" :height="stageRect && stageRect.height" :src="previewUrl"></iframe>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
@ -53,7 +59,10 @@ const defaultSelected = ref(dsl.items[0].id);
|
||||
const propsValues = ref<Record<string, any>>({});
|
||||
const propsConfigs = ref<Record<string, any>>({});
|
||||
const eventMethodList = ref<Record<string, any>>({});
|
||||
const stageRect = ref();
|
||||
const stageRect = ref({
|
||||
width: 375,
|
||||
height: 817,
|
||||
});
|
||||
|
||||
const previewUrl = computed(
|
||||
() => `${VITE_RUNTIME_PATH}/page/index.html?localPreview=1&page=${editor.value?.editorService.get('page').id}`,
|
||||
|
Loading…
x
Reference in New Issue
Block a user