diff --git a/build/bin/build-entry.js b/build/bin/build-entry.js index 6294590f1..27c7b9e96 100644 --- a/build/bin/build-entry.js +++ b/build/bin/build-entry.js @@ -1,4 +1,4 @@ -var Components = require('../../components.json'); +var Components = require('./get-components')(); var fs = require('fs'); var render = require('json-templater/string'); var uppercamelcase = require('uppercamelcase'); @@ -34,20 +34,17 @@ export { }; export default { install, - version, -{{list}} + version }; `; delete Components.font; -var ComponentNames = Object.keys(Components); - var includeComponentTemplate = []; var installTemplate = []; var listTemplate = []; -ComponentNames.forEach(name => { +Components.forEach(name => { var componentName = uppercamelcase(name); includeComponentTemplate.push(render(IMPORT_TEMPLATE, { diff --git a/build/bin/build-lib.js b/build/bin/build-lib.js index 0f59e218f..d20e2ba7c 100644 --- a/build/bin/build-lib.js +++ b/build/bin/build-lib.js @@ -12,7 +12,7 @@ const fs = require('fs'); const path = require('path'); -const components = require('../../components.json'); +const components = require('./get-components')(); const chalk = require('chalk'); require('shelljs/global'); @@ -38,7 +38,7 @@ log('Finished', 'build:vant-css'); // 5. build style entrys log('Starting', 'build:style-entries'); -Object.keys(components).forEach((componentName) => { +components.forEach((componentName) => { const dir = path.join(__dirname, '../../lib/', componentName, '/style'); const file = path.join(dir, 'index.js'); const cssPath = path.join(__dirname, '../../lib/vant-css/', `${componentName}.css`); diff --git a/build/bin/get-components.js b/build/bin/get-components.js new file mode 100644 index 000000000..9cc7a71fe --- /dev/null +++ b/build/bin/get-components.js @@ -0,0 +1,8 @@ +const fs = require('fs'); +const path = require('path'); + +module.exports = function() { + const dirs = fs.readdirSync(path.resolve(__dirname, '../../packages')); + const excludes = ['index.js', 'vant-css', 'mixins', 'utils']; + return dirs.filter(dirName => excludes.indexOf(dirName) === -1) +} diff --git a/build/bin/init.js b/build/bin/init.js index 2aa0b37d3..1cc94dc86 100644 --- a/build/bin/init.js +++ b/build/bin/init.js @@ -28,21 +28,4 @@ gulp.task('copy', function(callback) { }); }); - -// 添加到 components.json -gulp.task('addComponents', function(callback) { - const componentsFile = require('../../components.json'); - if (componentsFile[name]) { - console.error(`${name} 已存在.`); - process.exit(1); - } - componentsFile[name] = `./packages/${name}/index.js`; - fileSave(path.join(__dirname, '../../components.json')) - .write(JSON.stringify(componentsFile, null, ' '), 'utf8') - .end('\n'); - gutil.log('-------> components.json文件更新成功'); - gutil.log(gutil.colors.yellow('-------> 请无视下面的make报错')); -}); - -runSequence('copy', 'addComponents'); - +runSequence('copy'); diff --git a/build/genExamples.js b/build/genExamples.js deleted file mode 100644 index c668082f9..000000000 --- a/build/genExamples.js +++ /dev/null @@ -1,16 +0,0 @@ -const path = require('path'); -const docConfig = require('../docs/src/doc.config'); -const { extractExample } = require('zan-doc/src/helper'); - -function extract(watch = false) { - extractExample({ - src: path.resolve(__dirname, '../docs/examples-docs'), - dist: path.resolve(__dirname, '../docs/examples-dist'), - nav: docConfig['zh-CN'].nav, - watch - }); -} - -module.exports = function watch(isProduction) { - extract(!isProduction); -}; diff --git a/build/webpack.config.dev.js b/build/webpack.config.dev.js index 737712be8..e38ba86e3 100644 --- a/build/webpack.config.dev.js +++ b/build/webpack.config.dev.js @@ -6,11 +6,20 @@ const HtmlWebpackPlugin = require('html-webpack-plugin'); const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin'); const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin'); const isProduction = process.env.NODE_ENV === 'production'; +const docConfig = require('../docs/src/doc.config'); +const { extractExample } = require('zan-doc/src/helper'); const styleLoaders = [ { loader: 'css-loader' }, { loader: 'postcss-loader', options: { sourceMap: true } } ]; -require('./genExamples')(isProduction); + +// extract [components].vue from [components].md +extractExample({ + src: path.resolve(__dirname, '../docs/examples-docs'), + dist: path.resolve(__dirname, '../docs/examples-dist'), + nav: docConfig['zh-CN'].nav, + watch: !isProduction +}); module.exports = { entry: { @@ -25,6 +34,7 @@ module.exports = { chunkFilename: 'async.[name].js' }, devServer: { + host: '0.0.0.0', historyApiFallback: { rewrites: [ { from: /^\/zanui\/vue\/examples/, to: '/examples.html' }, @@ -51,6 +61,7 @@ module.exports = { { loader: 'vue-loader', options: { + preserveWhitespace: false, loaders: { postcss: ExtractTextPlugin.extract({ use: styleLoaders, @@ -104,7 +115,7 @@ module.exports = { }, render: function(tokens, idx) { - return tokens[idx].nesting === 1 + return tokens[idx].nesting === 1 ? `
` :`
\n`; } diff --git a/components.json b/components.json deleted file mode 100644 index dd4b25daa..000000000 --- a/components.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "button": "./packages/button/index.js", - "switch": "./packages/switch/index.js", - "field": "./packages/field/index.js", - "radio": "./packages/radio/index.js", - "cell": "./packages/cell/index.js", - "icon": "./packages/icon/index.js", - "cell-group": "./packages/cell-group/index.js", - "cell-swipe": "./packages/cell-swipe/index.js", - "popup": "./packages/popup/index.js", - "dialog": "./packages/dialog/index.js", - "picker": "./packages/picker/index.js", - "radio-group": "./packages/radio-group/index.js", - "waterfall": "./packages/waterfall/index.js", - "loading": "./packages/loading/index.js", - "panel": "./packages/panel/index.js", - "card": "./packages/card/index.js", - "steps": "./packages/steps/index.js", - "tag": "./packages/tag/index.js", - "checkbox": "./packages/checkbox/index.js", - "checkbox-group": "./packages/checkbox-group/index.js", - "badge-group": "./packages/badge-group/index.js", - "badge": "./packages/badge/index.js", - "search": "./packages/search/index.js", - "step": "./packages/step/index.js", - "tabs": "./packages/tabs/index.js", - "tab": "./packages/tab/index.js", - "lazyload": "./packages/lazyload/index.js", - "image-preview": "./packages/image-preview/index.js", - "col": "./packages/col/index.js", - "row": "./packages/row/index.js", - "actionsheet": "./packages/actionsheet/index.js", - "quantity": "./packages/quantity/index.js", - "progress": "./packages/progress/index.js", - "toast": "./packages/toast/index.js", - "uploader": "./packages/uploader/index.js", - "swipe": "./packages/swipe/index.js", - "swipe-item": "./packages/swipe-item/index.js", - "datetime-picker": "./packages/datetime-picker/index.js" -} diff --git a/docs/examples-docs/badge.md b/docs/examples-docs/badge.md index b0f27058c..6da67fc0c 100644 --- a/docs/examples-docs/badge.md +++ b/docs/examples-docs/badge.md @@ -1,29 +1,36 @@ ## Badge 徽章 @@ -39,48 +46,44 @@ Vue.component(Badge.name, Badge); #### 基础用法 -默认情况下激活第一个`badge`。 +通过在`van-badge-group`上设置`active-key`属性来控制选中的`badge` :::demo 基础用法 ```html -
- - - - - - -
+ + + + + + +``` + +``` javascript +export default { + data() { + return { + activeKey: 0 + }; + }, + methods: { + onClick(key) { + this.activeKey = key; + } + } +}; ``` ::: -#### 选中某个badge -如果想默认选中某个`badge`,你可以在`van-badge-group`上设置`activeKey`属性,属性值为对应的`badge`索引。 +### BadgeGroup API -:::demo 选中某个badge -```html -
- - - - - - -
-``` -::: - -### z-badge-group API - -| 参数 | 说明 | 类型 | 默认值 | 必须 | +| 参数 | 说明 | 类型 | 默认值 | 可选值 | |-----------|-----------|-----------|-------------|-------------| -| active-key | 激活的`badge`的索引 | `string` | `0`但必须子badge里的mark是有`0`位索引 | | +| active-key | 选中`badge`的索引 | `String | Number` | `0` | - | - -### z-badge API -| 参数 | 说明 | 类型 | 默认值 | 必须 | +### Badge API +| 参数 | 说明 | 类型 | 默认值 | 可选值 | |-----------|-----------|-----------|-------------|-------------| -| title | badge的文案标题 | `string` | `''` | `required` | -| info | 当前badge的提示消息 | `string` | `''` | | -| url | 跳转链接 | `string` | 链接直接跳转或者hash | | +| title | 内容 | `String` | `''` | - | +| info | 提示消息 | `String` | `''` | - | +| url | 跳转链接 | `String` | - | - | diff --git a/docs/examples-docs/button.md b/docs/examples-docs/button.md index 992cc5ccc..a5bfd47d2 100644 --- a/docs/examples-docs/button.md +++ b/docs/examples-docs/button.md @@ -7,6 +7,11 @@ &--bottom-action { margin-bottom: 15px; } + + &--small, + &--normal { + margin-right: 10px; + } } .zan-doc-demo-block { @@ -109,8 +114,8 @@ Vue.component(Button.name, Button); | type | 按钮类型 | `String` | `default` | `primary` `danger` | | size | 按钮尺寸 | `String` | `normal` | `large` `small` `mini` | | tag | 按钮标签 | `String` | `button` | 任意`HTML`标签 | -| nativeType | 按钮类型(原生) | `String` | `''` | | -| diabled | 是否禁用 | `Boolean` | `false` | | -| loading | 是否显示为加载状态 | `Boolean` | `false` | | -| block | 是否为块级元素 | `Boolean` | `false` | | -| bottomAction | 是否为底部行动按钮 | `Boolean` | `false` | | +| nativeType | 按钮类型(原生) | `String` | `''` | - | +| diabled | 是否禁用 | `Boolean` | `false` | - | +| loading | 是否显示为加载状态 | `Boolean` | `false` | - | +| block | 是否为块级元素 | `Boolean` | `false` | - | +| bottomAction | 是否为底部行动按钮 | `Boolean` | `false` | - | diff --git a/docs/examples-docs/card.md b/docs/examples-docs/card.md index 993c39f6d..2c586a78a 100644 --- a/docs/examples-docs/card.md +++ b/docs/examples-docs/card.md @@ -1,3 +1,13 @@ + + ## Card 图文组件 ### 使用指南 @@ -11,15 +21,9 @@ Vue.component(Card.name, Card); #### 基础用法 -当没有底部按钮时,右侧内容会居中显示。 - :::demo 基础用法 ```html - - + ``` ::: @@ -29,10 +33,9 @@ Vue.component(Card.name, Card); :::demo 高级用法 ```html - +
-

商品名称是什么,两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余

+

商品名称

¥ 2.00
@@ -50,11 +53,10 @@ Vue.component(Card.name, Card); | 参数 | 说明 | 类型 | 默认值 | 可选值 | |-----------|-----------|-----------|-------------|-------------| -| thumb | 左侧图片 | `string` | | | -| title | 标题 | `string` | | | -| desc | 描述 | `string` | | | -| centered | 内容是否垂直居中 | `string` | `false` | | - +| thumb | 左侧图片 | `String` | - | - | +| title | 标题 | `String` | - | - | +| desc | 描述 | `String` | - | - | +| centered | 内容是否垂直居中 | `String` | `false` | - | ### Slot @@ -62,6 +64,6 @@ Vue.component(Card.name, Card); |-----------|-----------| | title | 自定义标题 | | desc | 自定义描述 | -| tags | 自定义tags | -| thumb | 自定义thumb | -| footer | 自定义footer | +| tags | 自定义 tags | +| thumb | 自定义 thumb | +| footer | 自定义 footer | diff --git a/docs/examples-docs/cell-swipe.md b/docs/examples-docs/cell-swipe.md index 45225aabd..a16494da7 100644 --- a/docs/examples-docs/cell-swipe.md +++ b/docs/examples-docs/cell-swipe.md @@ -1,6 +1,6 @@ ## CellSwipe 滑动单元格 @@ -36,22 +32,21 @@ Vue.component(CellSwipe.name, CellSwipe); :::demo 基础用法 ```html + 选择 - 删除 - 选择 + 删除 ``` ::: - ### API | 参数 | 说明 | 类型 | 默认值 | 可选值 | |-----------|-----------|-----------|-------------|-------------| -| left-width | 左侧滑动按钮宽度 | `number` | 0 | | -| right-width | 右侧滑动按钮宽度 | `number` | 0 | | +| left-width | 左侧滑动区域宽度 | `Number` | `0` | - | +| right-width | 右侧滑动区域宽度 | `Number` | `0` | - | ### Slot diff --git a/docs/examples-docs/cell.md b/docs/examples-docs/cell.md index b2566b15a..bbad3c505 100644 --- a/docs/examples-docs/cell.md +++ b/docs/examples-docs/cell.md @@ -8,6 +8,21 @@ export default { }; + + ## Cell 单元格 ### 使用指南 @@ -22,86 +37,66 @@ Vue.component(CellGroup.name, CellGroup); #### 基础用法 -你可以将`van-cell-group`组件看成一个容器即可。 +将`van-cell-group`组件看成一个容器即可 :::demo 基础用法 ```html - + ``` ::: #### 只设置value - -只设置`value`时会向左对齐。 +只设置`value`时会向左对齐 :::demo 只设置value ```html - - + ``` ::: -#### 标题带描述信息 - -传入`label`属性,属性值为描述信息的值。 - -:::demo 标题带描述信息 +#### 展示图标 +通过`icon`属性在标题左侧展示图标 +:::demo 展示图标 ```html - - + ``` ::: -#### 带图标 +#### 展示箭头 +传入`isLink`属性则会在右侧显示箭头 -传入`icon`属性。 - -:::demo 带图标 +:::demo 展示箭头 ```html - - - -``` -::: - -#### 可点击的链接 - -传入`url`属性,传入`isLink`属性则会在右侧显示箭头。 - -:::demo 可点击的链接 -```html - - - + + ``` ::: #### 高级用法 - -如以上用法不能满足你的需求,可以使用对应的`slot`来自定义显示的内容。包含三个`slot`,默认`slot`、`icon`、`title`和`right-icon`的`slot`。 +如以上用法不能满足你的需求,可以使用对应的`slot`来自定义显示的内容 :::demo 高级用法 ```html - + - + @@ -112,12 +107,13 @@ Vue.component(CellGroup.name, CellGroup); | 参数 | 说明 | 类型 | 默认值 | 可选值 | |-----------|-----------|-----------|-------------|-------------| -| icon | 左侧图标 | `string` | | | -| title | 左侧标题 | `string` | | | -| value | 右侧内容 | `string` | | | -| isLink | 是否为链接,链接会在右侧出现箭头 | `boolean` | | | -| url | 跳转链接 | `string` | | | -| label | 描述信息,显示在标题下方 | `string` | | | +| icon | 左侧图标 | `String` | - | - | +| title | 左侧标题 | `String` | - | - | +| value | 右侧内容 | `String` | - | - | +| label | 标题下方的描述信息 | `String` | - | - | +| url | 跳转链接 | `String` | - | - | +| isLink | 是否展示右侧箭头 | `Boolean` | `false` | - | +| required | 是否显示表单必填符号 | `Boolean` | `false` | - | ### Slot diff --git a/docs/examples-docs/changelog.md b/docs/examples-docs/changelog.md index 545b0e180..46f58c413 100644 --- a/docs/examples-docs/changelog.md +++ b/docs/examples-docs/changelog.md @@ -1,5 +1,56 @@ ## 更新日志 +## [v0.8.8](https://github.com/youzan/vant/tree/v0.8.8) (2017-09-01) +[Full Changelog](https://github.com/youzan/vant/compare/v0.8.7...v0.8.8) + +**非兼容更新和新特性:** + +- Checkbox: support listen to change event [\#104](https://github.com/youzan/vant/pull/104) ([chenjiahan](https://github.com/chenjiahan)) +- add GoodsAction component [\#102](https://github.com/youzan/vant/pull/102) ([chenjiahan](https://github.com/chenjiahan)) +- add InvalidGoods component [\#100](https://github.com/youzan/vant/pull/100) ([chenjiahan](https://github.com/chenjiahan)) +- add OrderGoods component [\#99](https://github.com/youzan/vant/pull/99) ([chenjiahan](https://github.com/chenjiahan)) +- add PayOrder component [\#98](https://github.com/youzan/vant/pull/98) ([chenjiahan](https://github.com/chenjiahan)) + +**修复:** + +- 修复 make init bug [\#97](https://github.com/youzan/vant/pull/97) ([pangxie1991](https://github.com/pangxie1991)) + +**合并的 Pull Request (可能有不兼容改动):** + +- PayOrder component add tip slot [\#105](https://github.com/youzan/vant/pull/105) ([Raistlin916](https://github.com/Raistlin916)) +- Add deep-select component and fix a popup bug. [\#103](https://github.com/youzan/vant/pull/103) ([Tinysymphony](https://github.com/Tinysymphony)) +- Doc: update Step/Loading/Tag/Badge documents [\#101](https://github.com/youzan/vant/pull/101) ([chenjiahan](https://github.com/chenjiahan)) + +## [v0.8.7](https://github.com/youzan/vant/tree/v0.8.7) (2017-08-29) +[Full Changelog](https://github.com/youzan/vant/compare/v0.8.6...v0.8.7) + +**非兼容更新和新特性:** + +- add ExpressWay component [\#96](https://github.com/youzan/vant/pull/96) ([chenjiahan](https://github.com/chenjiahan)) +- add CellSwitch component [\#95](https://github.com/youzan/vant/pull/95) ([chenjiahan](https://github.com/chenjiahan)) +- add NoticeBar && test cases [\#94](https://github.com/youzan/vant/pull/94) ([chenjiahan](https://github.com/chenjiahan)) +- Dialog: support both function call and component call [\#93](https://github.com/youzan/vant/pull/93) ([chenjiahan](https://github.com/chenjiahan)) +- CellSwipe: improve test coverage && code review [\#91](https://github.com/youzan/vant/pull/91) ([chenjiahan](https://github.com/chenjiahan)) +- Progress: adjust DOM struct [\#90](https://github.com/youzan/vant/pull/90) ([chenjiahan](https://github.com/chenjiahan)) + +## [v0.8.6](https://github.com/youzan/vant/tree/v0.8.6) (2017-08-24) +[Full Changelog](https://github.com/youzan/vant/compare/v0.8.5...v0.8.6) + +**非兼容更新和新特性:** + +- dalete merge && class operating methods [\#88](https://github.com/youzan/vant/pull/88) ([chenjiahan](https://github.com/chenjiahan)) +- directory adjust: delete entry index.js [\#87](https://github.com/youzan/vant/pull/87) ([chenjiahan](https://github.com/chenjiahan)) +- Button: reduce unnecessary styles [\#86](https://github.com/youzan/vant/pull/86) ([chenjiahan](https://github.com/chenjiahan)) +- Layout: optimize doc [\#85](https://github.com/youzan/vant/pull/85) ([chenjiahan](https://github.com/chenjiahan)) + +**修复:** + +- Fix datetime-picker init value [\#89](https://github.com/youzan/vant/pull/89) ([w91](https://github.com/w91)) + +**处理的 Issue:** + +- When 'showIndicators' set to 'false' The second image does not show [\#80](https://github.com/youzan/vant/issues/80) + ## [v0.8.5](https://github.com/youzan/vant/tree/v0.8.5) (2017-08-21) [Full Changelog](https://github.com/youzan/vant/compare/v0.8.4...v0.8.5) diff --git a/docs/examples-docs/checkbox.md b/docs/examples-docs/checkbox.md index fdfcba1d7..ef23ecd81 100644 --- a/docs/examples-docs/checkbox.md +++ b/docs/examples-docs/checkbox.md @@ -45,8 +45,7 @@ Vue.component(Checkbox.name, Checkbox); ### 代码演示 #### 基础用法 - -通过`v-model`绑定值即可。当`Checkbox`选中时,绑定的值即为`true`,否则为`false`。当单个`Checkbox`使用时,更建议使用`Switch`组件。 +通过`v-model`绑定 checkbox 的勾选状态 :::demo 基础用法 ```html @@ -187,14 +186,20 @@ export default { | 参数 | 说明 | 类型 | 默认值 | 可选值 | |-----------|-----------|-----------|-------------|-------------| -| disabled | 是否禁用单选框 | `boolean` | `false` | | -| name | 根据这个来判断radio是否选中 | `boolean` | `false` | | +| disabled | 是否禁用单选框 | `Boolean` | `false` | - | +| name | 根据这个来判断radio是否选中 | `Boolean` | `false` | - | ### CheckboxGroup API | 参数 | 说明 | 类型 | 默认值 | 可选值 | |-----------|-----------|-----------|-------------|-------------| -| disabled | 是否禁用单选框 | `boolean` | `false` | | +| disabled | 是否禁用单选框 | `Boolean` | `false` | - | + +### Checkbox Event + +| 事件名称 | 说明 | 回调参数 | +|-----------|-----------|-----------| +| change | 当绑定值变化时触发的事件 | 当前组件的值 | ### CheckboxGroup Event diff --git a/docs/examples-docs/deep-select.md b/docs/examples-docs/deep-select.md new file mode 100644 index 000000000..846fdd9c5 --- /dev/null +++ b/docs/examples-docs/deep-select.md @@ -0,0 +1,169 @@ + + +## DeepSelect 分类选择组件 + +### 使用指南 +``` javascript +import { DeepSelect } from 'vant'; + +Vue.component(DeepSelect.name, DeepSelect); +``` + +### 代码演示 + +#### 基础用法 + +:::demo 基础用法 +```html + +``` + +```javascript +export default { + data() { + return { + items: items, + // 左侧高亮元素的index + mainActiveIndex: 0, + // 被选中元素的id + activeId: 1001 + }; + }, + methods: { + onNavClick(index) { + this.mainActiveIndex = index; + }, + onItemClick(data) { + console.log(data); + this.activeId = data.id; + } + } +} + +``` +::: + +### API + +#### 传入参数 + +| 参数 | 说明 | 类型 | 默认值 | 必须 | +|-----------|-----------|-----------|-------------|-------------| +| items | 分类显示所需的数据,具体数据结构可看 数据结构 | Array | [] | | +| mainActiveIndex | 左侧导航高亮的索引 | Number | 0 | | +| activeId | 右侧选择项,高亮的数据id | Number | 0 | | + +#### 事件 +| 事件名 | 说明 | 参数 | +|-----------|-----------|-----------| +| navclick | 左侧导航点击时,触发的事件 | index:被点击的导航的索引 | +| itemclick | 右侧选择项被点击时,会触发的事件 | data: 该点击项的数据 | + +### 数据格式 +#### items 分类显示所需数据的数据结构 +`items` 整体为一个数组,数组内包含一系列描述分类的 object。 + +每个分类里,text表示当前分类的名称。children 表示分类里的可选项,为数组结构,id被用来唯一标识每个选项 +```javascript +[ + { + // 导航名称 + text: '所有城市', + // 该导航下所有的可选项 + children: [ + { + // 可选项的名称 + text: '温州', + // 可选项的id,高亮的时候是根据id是否和选中的id是否相同进行判断的 + id: 1002 + }, + { + // 可选项的名称 + text: '杭州', + // 可选项的id,高亮的时候是根据id是否和选中的id是否相同进行判断的 + id: 1001 + } + ] + } +] +``` diff --git a/docs/examples-docs/express-way.md b/docs/examples-docs/express-way.md new file mode 100644 index 000000000..ee4d0ded4 --- /dev/null +++ b/docs/examples-docs/express-way.md @@ -0,0 +1,124 @@ +## ExpressWay 配送方式 + + + +### 使用指南 +``` javascript +import { ExpressWay } from 'vant'; + +Vue.component(ExpressWay.name, ExpressWay); +``` + +### 代码演示 + +#### 基础用法 + +:::demo 基础用法 +```html + diff --git a/packages/goods-action-mini-btn/index.vue b/packages/goods-action-mini-btn/index.vue new file mode 100644 index 000000000..4f91fd443 --- /dev/null +++ b/packages/goods-action-mini-btn/index.vue @@ -0,0 +1,30 @@ + + + diff --git a/packages/goods-action/index.vue b/packages/goods-action/index.vue new file mode 100644 index 000000000..8ab06d10a --- /dev/null +++ b/packages/goods-action/index.vue @@ -0,0 +1,11 @@ + + + diff --git a/packages/index.js b/packages/index.js index 3a1ca3699..9388bcb57 100644 --- a/packages/index.js +++ b/packages/index.js @@ -1,77 +1,97 @@ +import Actionsheet from './actionsheet'; +import Badge from './badge'; +import BadgeGroup from './badge-group'; import Button from './button'; -import Switch from './switch'; -import Field from './field'; -import Radio from './radio'; +import Card from './card'; import Cell from './cell'; -import Icon from './icon'; import CellGroup from './cell-group'; import CellSwipe from './cell-swipe'; -import Popup from './popup'; -import Dialog from './dialog'; -import Picker from './picker'; -import RadioGroup from './radio-group'; -import Waterfall from './waterfall'; -import Loading from './loading'; -import Panel from './panel'; -import Card from './card'; -import Steps from './steps'; -import Tag from './tag'; import Checkbox from './checkbox'; import CheckboxGroup from './checkbox-group'; -import BadgeGroup from './badge-group'; -import Badge from './badge'; +import Col from './col'; +import DatetimePicker from './datetime-picker'; +import DeepSelect from './deep-select'; +import Dialog from './dialog'; +import ExpressWay from './express-way'; +import Field from './field'; +import GoodsAction from './goods-action'; +import GoodsActionBigBtn from './goods-action-big-btn'; +import GoodsActionMiniBtn from './goods-action-mini-btn'; +import Icon from './icon'; +import ImagePreview from './image-preview'; +import InvalidGoods from './invalid-goods'; +import Lazyload from './lazyload'; +import Loading from './loading'; +import NoticeBar from './notice-bar'; +import OrderGoods from './order-goods'; +import Panel from './panel'; +import PayOrder from './pay-order'; +import Picker from './picker'; +import Popup from './popup'; +import Progress from './progress'; +import Quantity from './quantity'; +import Radio from './radio'; +import RadioGroup from './radio-group'; +import Row from './row'; import Search from './search'; import Step from './step'; -import Tabs from './tabs'; -import Tab from './tab'; -import Lazyload from './lazyload'; -import ImagePreview from './image-preview'; -import Col from './col'; -import Row from './row'; -import Actionsheet from './actionsheet'; -import Quantity from './quantity'; -import Progress from './progress'; -import Toast from './toast'; -import Uploader from './uploader'; +import Steps from './steps'; import Swipe from './swipe'; import SwipeItem from './swipe-item'; -import DatetimePicker from './datetime-picker'; +import Switch from './switch'; +import SwitchCell from './switch-cell'; +import Tab from './tab'; +import Tabs from './tabs'; +import Tag from './tag'; +import Toast from './toast'; +import Uploader from './uploader'; +import Waterfall from './waterfall'; -const version = '0.8.6'; +const version = '0.8.9'; const components = [ + Actionsheet, + Badge, + BadgeGroup, Button, - Switch, - Field, - Radio, + Card, Cell, - Icon, CellGroup, CellSwipe, - Popup, - Picker, - RadioGroup, - Loading, - Panel, - Card, - Steps, - Tag, Checkbox, CheckboxGroup, - BadgeGroup, - Badge, + Col, + DatetimePicker, + DeepSelect, + ExpressWay, + Field, + GoodsAction, + GoodsActionBigBtn, + GoodsActionMiniBtn, + Icon, + InvalidGoods, + Loading, + NoticeBar, + OrderGoods, + Panel, + PayOrder, + Picker, + Popup, + Progress, + Quantity, + Radio, + RadioGroup, + Row, Search, Step, - Tabs, - Tab, - Col, - Row, - Actionsheet, - Quantity, - Progress, - Uploader, + Steps, Swipe, SwipeItem, - DatetimePicker + Switch, + SwitchCell, + Tab, + Tabs, + Tag, + Uploader ]; const install = function(Vue) { @@ -90,84 +110,56 @@ if (typeof window !== 'undefined' && window.Vue) { export { install, version, + Actionsheet, + Badge, + BadgeGroup, Button, - Switch, - Field, - Radio, + Card, Cell, - Icon, CellGroup, CellSwipe, - Popup, - Dialog, - Picker, - RadioGroup, - Waterfall, - Loading, - Panel, - Card, - Steps, - Tag, Checkbox, CheckboxGroup, - BadgeGroup, - Badge, + Col, + DatetimePicker, + DeepSelect, + Dialog, + ExpressWay, + Field, + GoodsAction, + GoodsActionBigBtn, + GoodsActionMiniBtn, + Icon, + ImagePreview, + InvalidGoods, + Lazyload, + Loading, + NoticeBar, + OrderGoods, + Panel, + PayOrder, + Picker, + Popup, + Progress, + Quantity, + Radio, + RadioGroup, + Row, Search, Step, - Tabs, - Tab, - Lazyload, - ImagePreview, - Col, - Row, - Actionsheet, - Quantity, - Progress, - Toast, - Uploader, + Steps, Swipe, SwipeItem, - DatetimePicker + Switch, + SwitchCell, + Tab, + Tabs, + Tag, + Toast, + Uploader, + Waterfall }; export default { install, - version, - Button, - Switch, - Field, - Radio, - Cell, - Icon, - CellGroup, - CellSwipe, - Popup, - Dialog, - Picker, - RadioGroup, - Waterfall, - Loading, - Panel, - Card, - Steps, - Tag, - Checkbox, - CheckboxGroup, - BadgeGroup, - Badge, - Search, - Step, - Tabs, - Tab, - Lazyload, - ImagePreview, - Col, - Row, - Actionsheet, - Quantity, - Progress, - Toast, - Uploader, - Swipe, - SwipeItem, - DatetimePicker + version }; diff --git a/packages/invalid-goods/Card.vue b/packages/invalid-goods/Card.vue new file mode 100644 index 000000000..dff9c0e40 --- /dev/null +++ b/packages/invalid-goods/Card.vue @@ -0,0 +1,30 @@ + + + + diff --git a/packages/invalid-goods/index.vue b/packages/invalid-goods/index.vue new file mode 100644 index 000000000..d0e1079c7 --- /dev/null +++ b/packages/invalid-goods/index.vue @@ -0,0 +1,78 @@ + + + diff --git a/packages/mixins/popup/index.js b/packages/mixins/popup/index.js index cb98e2638..52317cbe2 100644 --- a/packages/mixins/popup/index.js +++ b/packages/mixins/popup/index.js @@ -99,6 +99,7 @@ export default { * 显示popup */ open() { + /* istanbul ignore if */ if (this.$isServer) return; if (this.opened) return; diff --git a/packages/mixins/popup/popup-context.js b/packages/mixins/popup/popup-context.js index 45cbae621..0e0588b7b 100644 --- a/packages/mixins/popup/popup-context.js +++ b/packages/mixins/popup/popup-context.js @@ -1,12 +1,7 @@ import Vue from 'vue'; -let context; const _global = Vue.prototype.$isServer ? global : window; -if (_global && _global.popupContext) { - context = _global.popupContext; -} - const DEFAULT_CONTEXT = { idSeed: 1, zIndex: 2000, @@ -15,23 +10,24 @@ const DEFAULT_CONTEXT = { modalStack: [] }; -context = _global.popupContext = { - ...DEFAULT_CONTEXT, - ...context -}; +if (!_global.popupContext) { + _global.popupContext = { + ...DEFAULT_CONTEXT + }; +} const PopupContext = { getContext(key) { - return context[key]; + return _global.popupContext[key]; }, setContext(key, value) { - context[key] = value; + _global.popupContext[key] = value; }, plusKeyByOne(key) { - const oldVal = +context[key]; - context[key] = oldVal + 1; + const oldVal = +_global.popupContext[key]; + _global.popupContext[key] = oldVal + 1; return oldVal; } diff --git a/packages/notice-bar/index.vue b/packages/notice-bar/index.vue new file mode 100644 index 000000000..4060dccc6 --- /dev/null +++ b/packages/notice-bar/index.vue @@ -0,0 +1,93 @@ + + + diff --git a/packages/order-goods/Card.vue b/packages/order-goods/Card.vue new file mode 100644 index 000000000..edfa63b90 --- /dev/null +++ b/packages/order-goods/Card.vue @@ -0,0 +1,102 @@ + + + diff --git a/packages/order-goods/Empty.vue b/packages/order-goods/Empty.vue new file mode 100644 index 000000000..f997cfe1a --- /dev/null +++ b/packages/order-goods/Empty.vue @@ -0,0 +1,25 @@ + + + diff --git a/packages/order-goods/Header.vue b/packages/order-goods/Header.vue new file mode 100644 index 000000000..956229556 --- /dev/null +++ b/packages/order-goods/Header.vue @@ -0,0 +1,26 @@ + + + diff --git a/packages/order-goods/Message.vue b/packages/order-goods/Message.vue new file mode 100644 index 000000000..36a9af8e2 --- /dev/null +++ b/packages/order-goods/Message.vue @@ -0,0 +1,50 @@ +