diff --git a/.gitignore b/.gitignore index 10f7dc74e..b45ad0807 100644 --- a/.gitignore +++ b/.gitignore @@ -12,7 +12,7 @@ package-lock.json es lib dist -docs/dist +./site changelog.generated.md test/coverage vetur diff --git a/docs/site/components/DemoList.vue b/docs/site/components/DemoList.vue deleted file mode 100644 index b6addce58..000000000 --- a/docs/site/components/DemoList.vue +++ /dev/null @@ -1,149 +0,0 @@ - - - - - diff --git a/docs/site/components/MobileNav.vue b/docs/site/components/MobileNav.vue deleted file mode 100644 index ba2969078..000000000 --- a/docs/site/components/MobileNav.vue +++ /dev/null @@ -1,74 +0,0 @@ - - - - - diff --git a/docs/site/desktop/App.vue b/docs/site/desktop/App.vue deleted file mode 100644 index 5c49a6fef..000000000 --- a/docs/site/desktop/App.vue +++ /dev/null @@ -1,74 +0,0 @@ - - - - - diff --git a/docs/site/desktop/index.html b/docs/site/desktop/index.html deleted file mode 100644 index c7fec0001..000000000 --- a/docs/site/desktop/index.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - Vant - 轻量、可靠的移动端 Vue 组件库 - - - - -
- - - - diff --git a/docs/site/desktop/main.js b/docs/site/desktop/main.js deleted file mode 100644 index 9cfd68c53..000000000 --- a/docs/site/desktop/main.js +++ /dev/null @@ -1,60 +0,0 @@ -import Vue from 'vue'; -import VueRouter from 'vue-router'; -import VantDoc from '@vant/doc'; -import App from './App'; -import routes from '../router'; -import { isMobile, importAll } from '../utils'; - -if (isMobile) { - location.replace('mobile.html' + location.hash); -} - -Vue.use(VueRouter).use(VantDoc); - -const docs = {}; -const docsFromMarkdown = require.context('../../markdown', false, /(en-US|zh-CN)\.md$/); -const docsFromPackages = require.context('../../../src', true, /README(\.zh-CN)?\.md$/); - -importAll(docs, docsFromMarkdown); -importAll(docs, docsFromPackages); - -const router = new VueRouter({ - mode: 'hash', - routes: routes({ componentMap: docs }), - scrollBehavior(to) { - if (to.hash) { - return { selector: to.hash }; - } - - return { x: 0, y: 0 }; - } -}); - -router.afterEach(() => { - Vue.nextTick(() => window.syncPath()); -}); - -window.vueRouter = router; - -if (process.env.NODE_ENV !== 'production') { - Vue.config.productionTip = false; -} - -new Vue({ - el: '#app', - mounted() { - if (this.$route.hash) { - // wait page init - setTimeout(() => { - const el = document.querySelector(this.$route.hash); - if (el) { - el.scrollIntoView({ - behavior: 'smooth' - }); - } - }, 1000); - } - }, - render: h => h(App), - router -}); diff --git a/docs/site/doc.config.js b/docs/site/doc.config.js deleted file mode 100644 index 40044c6d7..000000000 --- a/docs/site/doc.config.js +++ /dev/null @@ -1,717 +0,0 @@ -import pkgJson from '../../package.json'; - -const { version } = pkgJson; - -export const searchConfig = { - apiKey: '90067aecdaa2c85220e2783cd305caac', - indexName: 'vant' -}; - -export const versions = [version, '1.x']; - -export const github = 'https://github.com/youzan/vant'; - -export default { - 'zh-CN': { - header: { - logo: { - image: 'https://b.yzcdn.cn/vant/logo-white.png', - title: 'Vant', - href: '#/' - }, - nav: { - lang: { - text: 'En', - from: 'zh-CN', - to: 'en-US' - }, - logoLink: [ - { - image: 'https://b.yzcdn.cn/vant/logo/weapp.svg', - url: '/vant-weapp' - }, - { - image: 'https://b.yzcdn.cn/vant/logo/github.svg', - url: github - } - ] - } - }, - nav: [ - { - name: '开发指南', - groups: [ - { - list: [ - { - path: '/intro', - title: '介绍' - }, - { - path: '/quickstart', - title: '快速上手' - }, - { - path: '/changelog', - title: '更新日志' - }, - { - path: '/style', - title: '内置样式' - }, - { - path: '/theme', - title: '定制主题' - }, - { - path: '/contribution', - title: '开发指南' - }, - { - path: '/design', - title: '设计资源' - }, - { - path: '/style-guide', - title: '风格指南' - }, - { - path: '/locale', - title: '国际化' - } - ] - } - ] - }, - { - name: '组件', - showInMobile: true, - groups: [ - { - groupName: '基础组件', - icon: 'https://img.yzcdn.cn/vant/basic-0401.svg', - list: [ - { - path: '/button', - title: 'Button 按钮' - }, - { - path: '/cell', - title: 'Cell 单元格' - }, - { - path: '/icon', - title: 'Icon 图标' - }, - { - path: '/image', - title: 'Image 图片' - }, - { - path: '/col', - title: 'Layout 布局' - }, - { - path: '/popup', - title: 'Popup 弹出层' - } - ] - }, - { - groupName: '表单组件', - icon: 'orders-o', - list: [ - { - path: '/checkbox', - title: 'Checkbox 复选框' - }, - { - path: '/datetime-picker', - title: 'DatetimePicker 时间选择' - }, - { - path: '/field', - title: 'Field 输入框' - }, - { - path: '/number-keyboard', - title: 'NumberKeyboard 数字键盘' - }, - { - path: '/password-input', - title: 'PasswordInput 密码输入框' - }, - { - path: '/picker', - title: 'Picker 选择器' - }, - { - path: '/radio', - title: 'Radio 单选框' - }, - { - path: '/rate', - title: 'Rate 评分' - }, - { - path: '/search', - title: 'Search 搜索' - }, - { - path: '/slider', - title: 'Slider 滑块' - }, - { - path: '/stepper', - title: 'Stepper 步进器' - }, - { - path: '/switch', - title: 'Switch 开关' - }, - { - path: '/switch-cell', - title: 'SwitchCell 开关单元格' - }, - { - path: '/uploader', - title: 'Uploader 文件上传' - } - ] - }, - { - groupName: '反馈组件', - icon: 'gift-card-o', - list: [ - { - path: '/action-sheet', - title: 'ActionSheet 上拉菜单' - }, - { - path: '/dialog', - title: 'Dialog 弹出框' - }, - { - path: '/dropdown-menu', - title: 'DropdownMenu 下拉菜单' - }, - { - path: '/loading', - title: 'Loading 加载' - }, - { - path: '/notify', - title: 'Notify 消息通知' - }, - { - path: '/overlay', - title: 'Overlay 遮罩层' - }, - { - path: '/pull-refresh', - title: 'PullRefresh 下拉刷新' - }, - { - path: '/swipe-cell', - title: 'SwipeCell 滑动单元格' - }, - { - path: '/toast', - title: 'Toast 轻提示' - } - ] - }, - { - groupName: '展示组件', - icon: 'photo-o', - list: [ - { - path: '/circle', - title: 'Circle 环形进度条' - }, - { - path: '/collapse', - title: 'Collapse 折叠面板' - }, - { - path: '/count-down', - title: 'CountDown 倒计时' - }, - { - path: '/divider', - title: 'Divider 分割线' - }, - { - path: '/image-preview', - title: 'ImagePreview 图片预览' - }, - { - path: '/lazyload', - title: 'Lazyload 图片懒加载' - }, - { - path: '/list', - title: 'List 列表' - }, - { - path: '/notice-bar', - title: 'NoticeBar 通知栏' - }, - { - path: '/panel', - title: 'Panel 面板' - }, - { - path: '/progress', - title: 'Progress 进度条' - }, - { - path: '/skeleton', - title: 'Skeleton 骨架屏' - }, - { - path: '/steps', - title: 'Steps 步骤条' - }, - { - path: '/sticky', - title: 'Sticky 粘性布局' - }, - { - path: '/swipe', - title: 'Swipe 轮播' - }, - { - path: '/tag', - title: 'Tag 标记' - } - ] - }, - { - groupName: '导航组件', - icon: 'peer-pay', - list: [ - { - path: '/grid', - title: 'Grid 宫格' - }, - { - path: '/index-bar', - title: 'IndexBar 索引栏' - }, - { - path: '/nav-bar', - title: 'NavBar 导航栏' - }, - { - path: '/pagination', - title: 'Pagination 分页' - }, - { - path: '/sidebar', - title: 'Sidebar 侧边导航' - }, - { - path: '/tab', - title: 'Tab 标签页' - }, - { - path: '/tabbar', - title: 'Tabbar 标签栏' - }, - { - path: '/tree-select', - title: 'TreeSelect 分类选择' - } - ] - }, - { - groupName: '业务组件', - icon: 'other-pay', - list: [ - { - path: '/address-edit', - title: 'AddressEdit 地址编辑' - }, - { - path: '/address-list', - title: 'AddressList 地址列表' - }, - { - path: '/area', - title: 'Area 省市区选择' - }, - { - path: '/card', - title: 'Card 商品卡片' - }, - { - path: '/contact-card', - title: 'Contact 联系人' - }, - { - path: '/coupon-list', - title: 'Coupon 优惠券' - }, - { - path: '/goods-action', - title: 'GoodsAction 商品导航' - }, - { - path: '/submit-bar', - title: 'SubmitBar 提交订单栏' - }, - { - path: '/sku', - title: 'Sku 商品规格' - } - ] - } - ] - } - ] - }, - 'en-US': { - header: { - logo: { - image: 'https://b.yzcdn.cn/vant/logo-white.png', - title: 'Vant', - href: '#/' - }, - nav: { - lang: { - text: '中文', - from: 'en-US', - to: 'zh-CN' - }, - logoLink: [ - { - image: 'https://b.yzcdn.cn/vant/logo/github.svg', - url: github - } - ] - } - }, - nav: [ - { - name: 'Essentials', - groups: [ - { - list: [ - { - path: '/intro', - title: 'Introduction' - }, - { - path: '/quickstart', - title: 'Quickstart' - }, - { - path: '/changelog', - title: 'Changelog' - }, - { - path: '/style', - title: 'Built-in style' - }, - { - path: '/theme', - title: 'Custom Theme' - }, - { - path: '/locale', - title: 'Internationalization' - } - ] - } - ] - }, - { - name: 'Components', - showInMobile: true, - groups: [ - { - groupName: 'Basic Components', - icon: 'https://img.yzcdn.cn/vant/basic-0401.svg', - list: [ - { - path: '/button', - title: 'Button' - }, - { - path: '/cell', - title: 'Cell' - }, - { - path: '/icon', - title: 'Icon' - }, - { - path: '/image', - title: 'Image' - }, - { - path: '/col', - title: 'Layout' - }, - { - path: '/popup', - title: 'Popup' - } - ] - }, - { - groupName: 'Form Components', - icon: 'orders-o', - list: [ - { - path: '/checkbox', - title: 'Checkbox' - }, - { - path: '/datetime-picker', - title: 'DatetimePicker' - }, - { - path: '/field', - title: 'Field' - }, - { - path: '/number-keyboard', - title: 'NumberKeyboard' - }, - { - path: '/password-input', - title: 'PasswordInput' - }, - { - path: '/picker', - title: 'Picker' - }, - { - path: '/radio', - title: 'Radio' - }, - { - path: '/rate', - title: 'Rate' - }, - { - path: '/search', - title: 'Search' - }, - { - path: '/slider', - title: 'Slider' - }, - { - path: '/stepper', - title: 'Stepper' - }, - { - path: '/switch', - title: 'Switch' - }, - { - path: '/switch-cell', - title: 'SwitchCell' - }, - { - path: '/uploader', - title: 'Uploader' - } - ] - }, - { - groupName: 'Action Components', - icon: 'gift-card-o', - list: [ - { - path: '/action-sheet', - title: 'ActionSheet' - }, - { - path: '/dialog', - title: 'Dialog' - }, - { - path: '/dropdown-menu', - title: 'DropdownMenu' - }, - { - path: '/loading', - title: 'Loading' - }, - { - path: '/notify', - title: 'Notify' - }, - { - path: '/overlay', - title: 'Overlay' - }, - { - path: '/pull-refresh', - title: 'PullRefresh' - }, - { - path: '/swipe-cell', - title: 'SwipeCell' - }, - { - path: '/toast', - title: 'Toast' - } - ] - }, - { - groupName: 'Display Components', - icon: 'photo-o', - list: [ - { - path: '/circle', - title: 'Circle' - }, - { - path: '/collapse', - title: 'Collapse' - }, - { - path: '/count-down', - title: 'CountDown' - }, - { - path: '/divider', - title: 'Divider' - }, - { - path: '/image-preview', - title: 'ImagePreview' - }, - { - path: '/lazyload', - title: 'Lazyload' - }, - { - path: '/list', - title: 'List' - }, - { - path: '/notice-bar', - title: 'NoticeBar' - }, - { - path: '/panel', - title: 'Panel' - }, - { - path: '/progress', - title: 'Progress' - }, - { - path: '/skeleton', - title: 'Skeleton' - }, - { - path: '/steps', - title: 'Steps' - }, - { - path: '/sticky', - title: 'Sticky' - }, - { - path: '/swipe', - title: 'Swipe' - }, - { - path: '/tag', - title: 'Tag' - } - ] - }, - { - groupName: 'Navigation Components', - icon: 'peer-pay', - list: [ - { - path: '/grid', - title: 'Grid' - }, - { - path: '/index-bar', - title: 'IndexBar' - }, - { - path: '/nav-bar', - title: 'NavBar' - }, - { - path: '/pagination', - title: 'Pagination' - }, - { - path: '/sidebar', - title: 'Sidebar' - }, - { - path: '/tab', - title: 'Tab' - }, - { - path: '/tabbar', - title: 'Tabbar' - }, - { - path: '/tree-select', - title: 'TreeSelect' - } - ] - }, - { - groupName: 'Business Components', - icon: 'other-pay', - list: [ - { - path: '/address-edit', - title: 'AddressEdit' - }, - { - path: '/address-list', - title: 'AddressList' - }, - { - path: '/area', - title: 'Area' - }, - { - path: '/card', - title: 'Card' - }, - { - path: '/contact-card', - title: 'Contact' - }, - { - path: '/coupon-list', - title: 'Coupon' - }, - { - path: '/goods-action', - title: 'GoodsAction' - }, - { - path: '/submit-bar', - title: 'SubmitBar' - }, - { - path: '/sku', - title: 'Sku' - } - ] - } - ] - } - ] - } -}; diff --git a/docs/site/mobile/demo-common.js b/docs/site/mobile.js similarity index 63% rename from docs/site/mobile/demo-common.js rename to docs/site/mobile.js index de0338c1f..50a31c973 100644 --- a/docs/site/mobile/demo-common.js +++ b/docs/site/mobile.js @@ -1,23 +1,22 @@ -/** - * Demo Common Mixin && i18n - */ - import Vue from 'vue'; -import VueRouter from 'vue-router'; -import VantDoc from '@vant/doc'; -import i18n from '../utils/i18n'; -import Vant, { Lazyload, Locale } from '../../../src'; -import { camelize } from '../../../src/utils/format/string'; +import Locale from '../../src/locale'; +import { get } from '../../src/utils'; +import { camelize } from '../../src/utils/format/string'; -Vue - .use(Vant) - .use(VantDoc) - .use(VueRouter) - .use(Lazyload, { - lazyComponent: true - }); +Vue.mixin({ + computed: { + $t() { + const { name } = this.$options; + const prefix = name ? camelize(name) + '.' : ''; + const messages = this.$vantMessages[this.$vantLang]; -Vue.mixin(i18n); + return (path, ...args) => { + const message = get(messages, prefix + path) || get(messages, path); + return typeof message === 'function' ? message(...args) : message; + }; + } + } +}); Locale.add({ 'zh-CN': { @@ -77,21 +76,3 @@ Locale.add({ passwordPlaceholder: 'Password' } }); - -export function demoWrapper(module, name) { - const component = module.default; - name = 'demo-' + name; - component.name = name; - - const { i18n: config } = component; - if (config) { - const formattedI18n = {}; - const camelizedName = camelize(name); - Object.keys(config).forEach(key => { - formattedI18n[key] = { [camelizedName]: config[key] }; - }); - Locale.add(formattedI18n); - } - - return component; -} diff --git a/docs/site/mobile/App.vue b/docs/site/mobile/App.vue deleted file mode 100644 index 33a0fc5d6..000000000 --- a/docs/site/mobile/App.vue +++ /dev/null @@ -1,102 +0,0 @@ - - - - - diff --git a/docs/site/mobile/index.html b/docs/site/mobile/index.html deleted file mode 100644 index e0767fd10..000000000 --- a/docs/site/mobile/index.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - Vant - 轻量、可靠的移动端 Vue 组件库 - - - - - -
- - - diff --git a/docs/site/mobile/main.js b/docs/site/mobile/main.js deleted file mode 100644 index 0edac1185..000000000 --- a/docs/site/mobile/main.js +++ /dev/null @@ -1,38 +0,0 @@ -import '../../../src/index.less'; -import Vue from 'vue'; -import VueRouter from 'vue-router'; -import routes from '../router'; -import App from './App'; -import { importAll } from '../utils'; -import '@vant/touch-emulator'; - -const componentMap = {}; -const context = require.context('../../../src', true, /demo\/index.vue$/); - -importAll(componentMap, context); - -const router = new VueRouter({ - mode: 'hash', - routes: routes({ mobile: true, componentMap }), - scrollBehavior(to, from, savedPosition) { - return savedPosition || { x: 0, y: 0 }; - } -}); - -router.afterEach(() => { - if (!router.currentRoute.redirectedFrom) { - Vue.nextTick(() => window.syncPath()); - } -}); - -window.vueRouter = router; - -if (process.env.NODE_ENV !== 'production') { - Vue.config.productionTip = false; -} - -new Vue({ - el: '#app', - render: h => h(App), - router -}); diff --git a/docs/site/router.js b/docs/site/router.js deleted file mode 100644 index 223b5ff01..000000000 --- a/docs/site/router.js +++ /dev/null @@ -1,84 +0,0 @@ -import Vue from 'vue'; -import docConfig from './doc.config'; -import DemoList from './components/DemoList'; -import { demoWrapper } from './mobile/demo-common'; -import { initIframeRouter } from './utils/iframe-router'; - -initIframeRouter(); - -const registerRoute = ({ mobile, componentMap }) => { - const route = [ - { - path: '*', - redirect: () => `/${Vue.prototype.$vantLang}/` - } - ]; - - Object.keys(docConfig).forEach(lang => { - if (mobile) { - route.push({ - path: `/${lang}`, - component: DemoList, - meta: { lang } - }); - } else { - route.push({ - path: `/${lang}`, - redirect: `/${lang}/intro` - }); - } - - function addRoute(page, lang) { - let { path } = page; - if (path) { - path = path.replace('/', ''); - - let component; - if (mobile) { - const module = componentMap[`./${path}/demo/index.vue`]; - - if (module) { - component = demoWrapper(module, path); - } - } else { - const module = - componentMap[`./${path}/README.${lang}.md`] || - componentMap[`./${path}/README.md`] || - componentMap[`./${path}.${lang}.md`]; - - component = module.default; - } - - if (!component) { - return; - } - - route.push({ - component, - name: `${lang}/${path}`, - path: `/${lang}/${path}`, - meta: { - lang, - name: path, - title: page.title - } - }); - } - } - - const navs = docConfig[lang].nav || []; - navs.forEach(nav => { - if (nav.groups) { - nav.groups.forEach(group => { - group.list.forEach(page => addRoute(page, lang)); - }); - } else { - addRoute(nav, lang); - } - }); - }); - - return route; -}; - -export default registerRoute; diff --git a/docs/site/utils/i18n.js b/docs/site/utils/i18n.js deleted file mode 100644 index eb7022082..000000000 --- a/docs/site/utils/i18n.js +++ /dev/null @@ -1,18 +0,0 @@ -// component mixin -import { get } from '../../../src/utils'; -import { camelize } from '../../../src/utils/format/string'; - -export default { - computed: { - $t() { - const { name } = this.$options; - const prefix = name ? camelize(name) + '.' : ''; - const messages = this.$vantMessages[this.$vantLang]; - - return (path, ...args) => { - const message = get(messages, prefix + path) || get(messages, path); - return typeof message === 'function' ? message(...args) : message; - }; - } - } -}; diff --git a/docs/site/utils/iframe-router.js b/docs/site/utils/iframe-router.js deleted file mode 100644 index 88bc7be42..000000000 --- a/docs/site/utils/iframe-router.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * 同步父窗口和 iframe 的 vue-router 状态 - */ - -import { setLang } from './lang'; -import { iframeReady, isMobile } from '.'; - -export function initIframeRouter() { - window.syncPath = function () { - const router = window.vueRouter; - const isInIframe = window !== window.top; - const currentDir = router.history.current.path; - const pathParts = currentDir.split('/'); - let lang = pathParts[0]; - if (currentDir[0] === '/') { - lang = pathParts[1]; - } - - if (!isInIframe && !isMobile) { - const iframe = document.querySelector('iframe'); - if (iframe) { - iframeReady(iframe, () => { - iframe.contentWindow.changePath(lang, currentDir); - }); - } - setLang(lang); - } else if (isInIframe) { - window.top.changePath(lang, currentDir); - } - }; - - window.changePath = function (lang, path = '') { - setLang(lang); - - // should preserve hash for anchor - if (window.vueRouter.currentRoute.path !== path) { - window.vueRouter.replace(path).catch(() => {}); - } - }; -} diff --git a/docs/site/utils/index.js b/docs/site/utils/index.js deleted file mode 100644 index aa024122c..000000000 --- a/docs/site/utils/index.js +++ /dev/null @@ -1,33 +0,0 @@ -function iframeReady(iframe, callback) { - const doc = iframe.contentDocument || iframe.contentWindow.document; - const interval = () => { - if (iframe.contentWindow.changePath) { - callback(); - } else { - setTimeout(() => { - interval(); - }, 50); - } - }; - - if (doc.readyState === 'complete') { - interval(); - } else { - iframe.onload = interval; - } -} - -const ua = navigator.userAgent.toLowerCase(); -const isMobile = /ios|iphone|ipod|ipad|android/.test(ua); - -function importAll(map, r) { - r.keys().forEach(key => { - map[key] = r(key); - }); -} - -export { - isMobile, - importAll, - iframeReady -}; diff --git a/docs/site/utils/lang.js b/docs/site/utils/lang.js deleted file mode 100644 index 7e0d94817..000000000 --- a/docs/site/utils/lang.js +++ /dev/null @@ -1,45 +0,0 @@ -import Locale from '../../../src/locale'; -import zhCN from '../../../src/locale/lang/zh-CN'; -import enUS from '../../../src/locale/lang/en-US'; - -const langMap = { - 'en-US': { - title: 'Vant - Mobile UI Components built on Vue', - messages: enUS - }, - 'zh-CN': { - title: 'Vant - 轻量、可靠的移动端 Vue 组件库', - messages: zhCN - } -}; - -let currentLang = ''; - -function getDefaultLang() { - const langs = Object.keys(langMap); - const { hash } = location; - - for (let i = 0; i < langs.length; i++) { - if (hash.indexOf(langs[i]) !== -1) { - return langs[i]; - } - } - - const userLang = localStorage.getItem('VANT_LANGUAGE') || navigator.language || 'en-US'; - return userLang.indexOf('zh-') !== -1 ? 'zh-CN' : 'en-US'; -} - -export function setLang(lang) { - if (currentLang === lang) { - return; - } - - currentLang = lang; - if (window.localStorage) { - localStorage.setItem('VANT_LANGUAGE', lang); - } - Locale.use(lang, langMap[lang].messages); - document.title = langMap[lang].title; -} - -setLang(getDefaultLang()); diff --git a/packages/vant-cli/site/desktop/components/Header.vue b/packages/vant-cli/site/desktop/components/Header.vue index e3ca12d68..c3b7e0cc7 100644 --- a/packages/vant-cli/site/desktop/components/Header.vue +++ b/packages/vant-cli/site/desktop/components/Header.vue @@ -58,7 +58,6 @@ export default { }, data() { - console.log(this.config); return { showVersionPop: false }; diff --git a/packages/vant-cli/site/mobile/main.js b/packages/vant-cli/site/mobile/main.js index 252b483de..5c735e56f 100644 --- a/packages/vant-cli/site/mobile/main.js +++ b/packages/vant-cli/site/mobile/main.js @@ -12,8 +12,10 @@ if (process.env.NODE_ENV !== 'production') { Vue.component(DemoBlock.name, DemoBlock); Vue.component(DemoSection.name, DemoSection); -new Vue({ - el: '#app', - render: h => h(App), - router -}); +setTimeout(() => { + new Vue({ + el: '#app', + render: h => h(App), + router + }); +}, 0); diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 000000000..2aaad1fef --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,5 @@ +module.exports = { + entry: { + 'site-mobile': ['./docs/site/mobile'] + }, +};