'\r\n const target = `\u003Cdiv id=\"app\">\u003C/div>`\r\n this.shadow = this.attachShadow({ mode: 'open' })\r\n this.shadow.innerHTML = designSystemCSS + target\r\n createApp(App) // App defined elsewhere ofc\r\n .mount(this.shadow.querySelector('#app'))\r\n }\r\n}\r\n```\n\n### Describe the solution you'd like\n\nProbably just being able to set `compilerOptions.isCustomElement` somewhere would be good enough?\n\n### Describe alternatives you've considered\n\n_No response_\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [X] Read the [docs](https://vitepress.vuejs.org).\n- [X] Read the [Contributing Guidelines](https://github.com/vuejs/vitepress/blob/main/.github/contributing.md).\n- [X] Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.",[],735,"Custom element support","2023-01-21T14:34:18Z","https://github.com/vuejs/vitepress/issues/735",0.72443956,{"description":2945,"labels":2946,"number":2950,"owner":2875,"repository":2876,"state":2895,"title":2951,"updated_at":2952,"url":2953,"score":2954},"Although I add `vitepress.d.ts` to define the type for [global computed](https://vitepress.vuejs.org/guide/global-computed.html) - work in vue typescript --> Not work! Hope your team can have some guide for this!\r\n\r\nThis is my `vitepress.d.ts`\r\n```ts\r\nimport Vue from 'vue'\r\n\r\ndeclare module 'vue/types/vue' {\r\n interface Vue {\r\n $site: {\r\n base: string\r\n\t title: string\r\n }\r\n }\r\n}\r\n```\r\n\r\nIn my vue file --> Had this error: `Cannot find name '$site'.`\r\n```vue\r\n\u003Ca :aria-label=\"$site.title + '--> to home'\" :href=\"$site.base\">\r\n \u003Cspan class=\"font-bold\">Hello\u003C/span>\r\n\u003Ca>\r\n```",[2947],{"name":2948,"color":2949},"question","5D5FAE",246,"[Global Computed] Can not declare more properties in vue instance - typescript","2023-01-21T14:35:41Z","https://github.com/vuejs/vitepress/issues/246",0.72724926,{"description":2956,"labels":2957,"number":2958,"owner":2875,"repository":2876,"state":2895,"title":2959,"updated_at":2960,"url":2961,"score":2962},"### Is your feature request related to a problem? Please describe.\r\n\r\n许多第三方库会在导入时的顶层代码中访问 `window` 或者 `document`\r\n我不可能在第三库的源码中加上条件判断,这是不切实际的。\r\n\r\n假设有一个Vue插件模块名字就叫 \"a-vue-plugin\",并且假设它提供了大量有用的Vue组件或者实用功能。\r\n```typescript\r\nwindow.ABC = 123 // 这个模块在代码顶层就访问里 window\r\n\r\nconst plugin = {\r\n // ...\r\n}\r\n\r\nexport default plugin\r\n```\r\n\r\ndocs/.vitepress/theme/index.ts\r\n```typescript\r\n// ...\r\nimport { plugin } from 'a-vue-plugin''\r\n\r\nexport default define\u003CTheme>({\r\n NotFound,\r\n Layout: VPApp,\r\n enhanceApp: ({ app }) => {\r\n // 这样写显然是无济于事的,因为在执行 import { plugin } from 'a-vue-plugin' 时就已经访问到 window 了 \r\n if (!import.meta.env.SSR) {\r\n app.use(plugin) // 这里需要使用这个插件\r\n }\r\n },\r\n})\r\n```\r\n最终抛出错误\r\n```\r\n⠋ rendering pages...ReferenceError: window is not defined\r\n```\r\n\r\n### Describe the solution you'd like\r\n\r\n目前缺少完全合理的解决方案,请求官方针对此问题提供标准的解决方案或者规避方案。\r\n\r\n### Describe alternatives you've considered\r\n\r\n这是一个可能的解决方案,但需要 enhanceApp 支持异步才行。\r\n```typescript\r\nexport default define\u003CTheme>({\r\n NotFound,\r\n Layout: VPApp,\r\n enhanceApp: async ({ app }) => {\r\n if (!import.meta.env.SSR) {\r\n const plugin = (await import('a-vue-plugin')).default\r\n app.use(plugin)\r\n }\r\n },\r\n})\r\n```\r\n\r\n### Additional context\r\n\r\n类似的问题 [#](https://github.com/vuejs/vitepress/issues/1727#issue-1507239476)\r\n\r\n### Validations\r\n\r\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\r\n- [X] Read the [docs](https://vitepress.vuejs.org).\r\n- [X] Read the [Contributing Guidelines](https://github.com/vuejs/vitepress/blob/main/.github/contributing.md).\r\n- [X] Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.",[],1884,"如何针对静态导入跳过SSR?","2023-03-23T00:04:27Z","https://github.com/vuejs/vitepress/issues/1884",0.72904134,["Reactive",2964],{},["Set"],["ShallowReactive",2967],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fTn3WWI7wVivNlq74GP7BPtZIHxewSlZzpkfpw-Hqvv4":-1},"/vuejs/vitepress/1937"]