Closed
Description
描述这个Bug
const { width } = useWindowSize();
const isMobile = computed(() => width.value < 960);
onMounted(() => {
if (width.value < 960) {
// editorRef.value?.togglePreview(false);
containWidth.value = "margin: 0 10px 0 10px";
} else {
containWidth.value = "width:1200px";
}
changeLayout();
window.addEventListener("resize", changeLayout);
window.addEventListener("beforeunload", handleBeforeUnload);
});
const changeLayout = () => {
if (width.value < 480) {
// 在移动端不现实分屏预览,要么编辑,要么仅预览
state.toolbars = [
"previewOnly",
...toolbars.filter(
(item) => !(["preview", "previewOnly"] as any).includes(item)
),
];
state.inputBoxWidth = "100%";
editorRef.value?.togglePreview(false);
} else {
state.toolbars = toolbars;
state.inputBoxWidth = "50%";
editorRef.value?.togglePreview(true);
}
};
代码如上,在手机端的时候 编辑态点击目录空白,点击切换预览态,目录就会显示出来 试了下如果将 editorRef.value?.togglePreview(false); 不使用则不会有这个鹅问题


版本号
5.2.1
问题重现链接
No response