diff --git a/package.json b/package.json index 57f187f9d..7c682baa1 100644 --- a/package.json +++ b/package.json @@ -17,11 +17,12 @@ "dev": "vant-cli dev", "lint": "vant-cli lint", "test": "vant-cli test", - "test:watch": "vant-cli test --watch", - "test:coverage": "open test/coverage/index.html", - "changelog": "vant-cli changelog ./docs/changelog.generated.md", + "build": "vant-cli build", "release": "vant-cli release", - "release:site": "sh build/release-site.sh" + "test:watch": "vant-cli test --watch", + "release:site": "sh build/release-site.sh", + "test:coverage": "open test/coverage/index.html", + "changelog": "vant-cli changelog ./docs/changelog.generated.md" }, "husky": { "hooks": { diff --git a/src/style/base.less b/src/style/base.less index b1b1ed89c..086daec7f 100644 --- a/src/style/base.less +++ b/src/style/base.less @@ -8,10 +8,3 @@ @import './clearfix'; @import './hairline'; @import './animation'; -@import '../info/index'; -@import '../icon/index'; -@import '../loading/index'; -@import '../button/index'; -@import '../cell/index'; -@import '../cell-group/index'; -@import '../overlay/index'; diff --git a/vant.config.js b/vant.config.js index 10afba40e..aa662935a 100644 --- a/vant.config.js +++ b/vant.config.js @@ -21,648 +21,650 @@ module.exports = { } }, site: { - i18n: true, - 'zh-CN': { - ...sharedSiteConfig, - description: '轻量、可靠的移动端 Vue 组件库', - nav: [ - { - title: '开发指南', - items: [ - { - 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: '国际化' - } - ] - }, - { - title: '基础组件', - icon: 'https://img.yzcdn.cn/vant/basic-0401.svg', - items: [ - { - path: 'button', - title: 'Button 按钮' - }, - { - path: 'cell', - title: 'Cell 单元格' - }, - { - path: 'icon', - title: 'Icon 图标' - }, - { - path: 'image', - title: 'Image 图片' - }, - { - path: 'col', - title: 'Layout 布局' - }, - { - path: 'popup', - title: 'Popup 弹出层' - } - ] - }, - { - title: '表单组件', - icon: 'orders-o', - items: [ - { - 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 文件上传' - } - ] - }, - { - title: '反馈组件', - icon: 'gift-card-o', - items: [ - { - 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 轻提示' - } - ] - }, - { - title: '展示组件', - icon: 'photo-o', - items: [ - { - 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 标记' - } - ] - }, - { - title: '导航组件', - icon: 'peer-pay', - items: [ - { - 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 分类选择' - } - ] - }, - { - title: '业务组件', - icon: 'other-pay', - items: [ - { - 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': { - ...sharedSiteConfig, - description: 'Mobile UI Components built on Vue', - nav: [ - { - title: 'Essentials', - items: [ - { - 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' - } - ] - }, - { - title: 'Basic Components', - icon: 'https://img.yzcdn.cn/vant/basic-0401.svg', - items: [ - { - path: 'button', - title: 'Button' - }, - { - path: 'cell', - title: 'Cell' - }, - { - path: 'icon', - title: 'Icon' - }, - { - path: 'image', - title: 'Image' - }, - { - path: 'col', - title: 'Layout' - }, - { - path: 'popup', - title: 'Popup' - } - ] - }, - { - title: 'Form Components', - icon: 'orders-o', - items: [ - { - 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' - } - ] - }, - { - title: 'Action Components', - icon: 'gift-card-o', - items: [ - { - 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' - } - ] - }, - { - title: 'Display Components', - icon: 'photo-o', - items: [ - { - 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' - } - ] - }, - { - title: 'Navigation Components', - icon: 'peer-pay', - items: [ - { - 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' - } - ] - }, - { - title: 'Business Components', - icon: 'other-pay', - items: [ - { - 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' - } - ] - } - ] + defaultLang: 'en-US', + locales: { + 'zh-CN': { + ...sharedSiteConfig, + description: '轻量、可靠的移动端 Vue 组件库', + nav: [ + { + title: '开发指南', + items: [ + { + 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: '国际化' + } + ] + }, + { + title: '基础组件', + icon: 'https://img.yzcdn.cn/vant/basic-0401.svg', + items: [ + { + path: 'button', + title: 'Button 按钮' + }, + { + path: 'cell', + title: 'Cell 单元格' + }, + { + path: 'icon', + title: 'Icon 图标' + }, + { + path: 'image', + title: 'Image 图片' + }, + { + path: 'col', + title: 'Layout 布局' + }, + { + path: 'popup', + title: 'Popup 弹出层' + } + ] + }, + { + title: '表单组件', + icon: 'orders-o', + items: [ + { + 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 文件上传' + } + ] + }, + { + title: '反馈组件', + icon: 'gift-card-o', + items: [ + { + 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 轻提示' + } + ] + }, + { + title: '展示组件', + icon: 'photo-o', + items: [ + { + 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 标记' + } + ] + }, + { + title: '导航组件', + icon: 'peer-pay', + items: [ + { + 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 分类选择' + } + ] + }, + { + title: '业务组件', + icon: 'other-pay', + items: [ + { + 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': { + ...sharedSiteConfig, + description: 'Mobile UI Components built on Vue', + nav: [ + { + title: 'Essentials', + items: [ + { + 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' + } + ] + }, + { + title: 'Basic Components', + icon: 'https://img.yzcdn.cn/vant/basic-0401.svg', + items: [ + { + path: 'button', + title: 'Button' + }, + { + path: 'cell', + title: 'Cell' + }, + { + path: 'icon', + title: 'Icon' + }, + { + path: 'image', + title: 'Image' + }, + { + path: 'col', + title: 'Layout' + }, + { + path: 'popup', + title: 'Popup' + } + ] + }, + { + title: 'Form Components', + icon: 'orders-o', + items: [ + { + 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' + } + ] + }, + { + title: 'Action Components', + icon: 'gift-card-o', + items: [ + { + 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' + } + ] + }, + { + title: 'Display Components', + icon: 'photo-o', + items: [ + { + 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' + } + ] + }, + { + title: 'Navigation Components', + icon: 'peer-pay', + items: [ + { + 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' + } + ] + }, + { + title: 'Business Components', + icon: 'other-pay', + items: [ + { + 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' + } + ] + } + ] + } } } };