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