Skip to content

通过iframe将文档嵌入其他页面,右侧文档目录结构无法显示,如何解决 #935

Closed Answered by Timeless0911
wanglilin0628 asked this question in Q&A
Discussion options

You must be logged in to vote

This is the default behavior when you use iframe, you can see the logic in

const getShowAside = () => {
// if in iframe, default value is false
const defaultHasAside =
typeof window === 'undefined' ? true : window.top === window.self;
return (
(frontmatter?.outline ?? themeConfig?.outline ?? defaultHasAside) &&
!isOverviewPage
);
};

The frontMatter config in pages or the themeConfig for all have a higher priority to control the display of aside component, you can set it on your own.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@wanglilin0628
Comment options

Answer selected by wanglilin0628
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants