diff --git a/docs/site/mobile.js b/docs/site/entry.js similarity index 100% rename from docs/site/mobile.js rename to docs/site/entry.js diff --git a/packages/vant-cli/site/desktop/main.js b/packages/vant-cli/site/desktop/main.js index 3f4c4d7b0..d27bd765e 100644 --- a/packages/vant-cli/site/desktop/main.js +++ b/packages/vant-cli/site/desktop/main.js @@ -7,5 +7,8 @@ import { router } from './router'; window.app = createApp(App) .use(router) .use(packageEntry) - .component(DemoPlayground.name, DemoPlayground) - .mount('#app'); + .component(DemoPlayground.name, DemoPlayground); + +setTimeout(() => { + window.app.mount('#app'); +}, 0); diff --git a/webpack.config.js b/webpack.config.js index 56f0ffdcd..a0792f558 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -8,7 +8,8 @@ module.exports = function () { return { devtool: false, entry: { - 'site-mobile': ['./docs/site/mobile'], + 'site-mobile': ['./docs/site/entry'], + 'site-desktop': ['./docs/site/entry'], }, resolve: { alias: {