Browse Source

docs: 更新内容添加版本号 (#1326)

* feat: datepicker 国际化

* feat: popover 功能补全

* feat: 添加更新版本号

* docs: datepicker 版本号添加
yangxiaolu1993 3 years ago
parent
commit
dc5e890eef

+ 4 - 4
src/packages/__VUE/cascader/doc.en-US.md

@@ -431,10 +431,10 @@ export default {
 | text-key            | Customize the fields of `text` in the `options` structure                                                    | String   | -           |
 | children-key        | Customize the fields of `children` in the `options` structure                                                | String   | -           |
 | convert-config      | When options is a flat structure that can be converted into a tree structure, configure the conversion rules | Object   | -           |
-| title               | Title                                                                                                        | String   | ''          |
-| close-icon-position | Cancel the button position and inherit the popup component                                                   | String   | "top-right" |
-| close-icon          | Customize the close button and inherit the popup component                                                   | String   | "close"     |
-| closeable           | Whether to display the close button and inherit the popup component                                          | Boolean  | true        |
+| title `v3.1.21`     | Title                                                                                                        | String   | ''          |
+| close-icon-position `v3.1.21` | Cancel the button position and inherit the popup component                                                   | String   | "top-right" |
+| close-icon `v3.1.21` | Customize the close button and inherit the popup component                                                   | String   | "close"     |
+| closeable `v3.1.21` | Whether to display the close button and inherit the popup component                                          | Boolean  | true        |
 
 ### Events
 

+ 4 - 4
src/packages/__VUE/cascader/doc.md

@@ -431,10 +431,10 @@ export default {
 | text-key       | 自定义`options`结构中`text`的字段                     | String   | -      |
 | children-key   | 自定义`options`结构中`children`的字段                 | String   | -      |
 | convert-config | 当options为可转换为树形结构的扁平结构时,配置转换规则 | Object   | -      |
-| title | 标题 | String   | ''      |
-| close-icon-position | 取消按钮位置,继承 Popup 组件 | String   | "top-right"      |
-| close-icon | 自定义关闭按钮,继承 Popup 组件 | String   | "close"     |
-| closeable | 是否显示关闭按钮,继承 Popup 组件 | Boolean   | true     |
+| title `v3.1.21` | 标题 | String   | ''      |
+| close-icon-position `v3.1.21` | 取消按钮位置,继承 Popup 组件 | String   | "top-right"      |
+| close-icon `v3.1.21` | 自定义关闭按钮,继承 Popup 组件 | String   | "close"     |
+| closeable `v3.1.21` | 是否显示关闭按钮,继承 Popup 组件 | Boolean   | true     |
 
 ### Events
 

+ 6 - 6
src/packages/__VUE/countdown/doc.md

@@ -313,13 +313,13 @@ app.use(CountDown);
 | v-model | 当前时间,自定义展示内容时生效 | Object | {}
 | start-time | 开始时间 | String, Number | Date.now()
 | end-time | 结束时间 | String, Number | Date.now()
-| format |  时间格式 | String | HH:mm:ss
-| millisecond |  是否开启毫秒级渲染 | Boolean | false
-| auto-start |  是否自动开始倒计时 | Boolean | true
-| time | 倒计时显示时间,单位是毫秒。autoStart 为 false 时生效 | String,Number | 0
+| format `v3.1.20` |  时间格式 | String | HH:mm:ss
+| millisecond `v3.1.20` |  是否开启毫秒级渲染 | Boolean | false
+| auto-start `v3.1.20` |  是否自动开始倒计时 | Boolean | true
+| time `v3.1.20` | 倒计时显示时间,单位是毫秒。autoStart 为 false 时生效 | String,Number | 0
 | paused | 是否暂停 | Boolean | false
-| show-days | 是否显示天`(废弃)` | Boolean | false
-| show-plain-text | 显示为纯文本`(废弃)` | Boolean | false
+| show-days | 是否显示天`v3.1.20(废弃)` | Boolean | false
+| show-plain-text | 显示为纯文本`v3.1.20(废弃)` | Boolean | false
 
 ### format 格式
 

+ 2 - 2
src/packages/__VUE/datepicker/doc.md

@@ -381,8 +381,8 @@ DatetimePicker 通过 type 属性来定义需要选择的时间类型。将 type
 | is-show-chinese | 每列是否展示中文                                  | Boolean | `false`  |
 | min-date        | 开始日期                                          | Date    | `十年前` |
 | max-date        | 结束日期                                          | Date    | `十年后` |
-| formatter       | 选项格式化函数                                          | (type: string, option: PickerOption) => PickerOption    |  |
-| filter        | 选项过滤函数                                          | (type: string, option: PickerOption) => PickerOption[]    |  |
+| formatter `v3.1.18`  | 选项格式化函数                                          | (type: string, option: PickerOption) => PickerOption    |  |
+| filter  `v3.1.18`  | 选项过滤函数                                          | (type: string, option: PickerOption) => PickerOption[]    |  |
 | title           | 设置标题                                          | String  | `null`   |
 | ok-text           | 确定按钮文案                                          | String  | 确定   |
 | cancel-text           | 取消按钮文案                                          | String  | 取消   |

+ 1 - 1
src/packages/__VUE/noticebar/doc.en-US.md

@@ -227,7 +227,7 @@ When text is long, you can enable multi-line display by setting the wrapable pro
 | delay      | Delay time                                         | String/Number | 1       |
 | scrollable | Whether to scroll content                          | Boolean       | true    |
 | speed      | Scrolling speed (px/s)                             | Number         | 50      |
-| wrapable   | Whether to enable text wrap                        | Boolean       | false    |
+| wrapable`v3.1.18` | Whether to enable text wrap                        | Boolean       | false    |
 
 ### Prop(direction=vertical)
 

+ 1 - 1
src/packages/__VUE/noticebar/doc.md

@@ -229,7 +229,7 @@ app.use(NoticeBar);
 | delay      | 延时多少秒                                                 | String/Number | 1      |
 | scrollable | 是否可以滚动                                               | Boolean       | true   |
 | speed      | 滚动速率 (px/s)                                            | Number        | 50     |
-| wrapable   | 是否开启文本换行                                           | Boolean       | false    |
+| wrapable `v3.1.18`  | 是否开启文本换行                                           | Boolean       | false    |
 
 ### Prop(direction=vertical)
 

+ 0 - 17
src/packages/__VUE/popover/__test__/__snapshots__/popover.spec.ts.snap

@@ -1,17 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should change icon class prefix when using icon prop 1`] = `
-"<view class=\\"nut-popover nut-popover--light\\">
-  <div></div>
-  <!--v-if-->
-</view>"
-`;
-
-exports[`should watch placement prop and update location 1`] = `""`;
-
-exports[`slots 1`] = `
-"<view class=\\"nut-popover nut-popover--light\\">
-  <div></div>
-  <!--v-if-->
-</view>"
-`;

+ 0 - 103
src/packages/__VUE/popover/__test__/popover.spec.ts

@@ -1,103 +0,0 @@
-import { mount, config } from '@vue/test-utils';
-import Popover from '../index.vue';
-
-import NutIcon from '../../icon/index.vue';
-
-beforeAll(() => {
-  config.global.components = {
-    NutIcon
-  };
-});
-
-afterAll(() => {
-  config.global.components = {};
-});
-
-const baseActions = [
-  {
-    name: '选项一',
-    icon: 'my2'
-  },
-  {
-    name: '选项二',
-    icon: 'cart2'
-  },
-  {
-    name: '选项三',
-    icon: 'location2'
-  }
-];
-
-test('should emit click event when clicking the list', async () => {
-  const wrapper = mount(Popover, {
-    props: {
-      visible: true,
-      list: baseActions
-    }
-  });
-  await wrapper.find('.title-item').trigger('click');
-  expect(wrapper.emitted('choose')![0]).toEqual([baseActions[0], 0]);
-});
-
-test('should not emit click event when the list is disabled', () => {
-  const wrapper = mount(Popover, {
-    props: {
-      visible: true,
-      list: [
-        {
-          name: '选项一',
-          disabled: true
-        }
-      ]
-    }
-  });
-
-  wrapper.find('.title-item').trigger('click');
-  expect(wrapper.emitted('choose')).toBeFalsy();
-});
-
-test('should close popover when clicking the list', async () => {
-  const wrapper = mount(Popover, {
-    props: {
-      visible: true,
-      list: baseActions
-    }
-  });
-
-  await wrapper.find('.more-background').trigger('click');
-  expect(wrapper.emitted('update:visible')![0]).toEqual([false]);
-});
-
-test('should watch placement prop and update location', async () => {
-  const root = document.createElement('div');
-  const wrapper = mount(Popover, {
-    props: {
-      visible: true
-    }
-  });
-
-  await wrapper.setProps({
-    location: 'right'
-  });
-
-  expect(root.innerHTML).toMatchSnapshot();
-});
-
-test('should change icon class prefix when using icon prop', () => {
-  const wrapper = mount(Popover, {
-    props: {
-      list: [{ icon: 'success', name: 'foo' }]
-    }
-  });
-
-  expect(wrapper.html()).toMatchSnapshot();
-});
-test('slots', () => {
-  const wrapper = mount(Popover, {
-    slots: {
-      content: () => 'Custom content'
-    }
-  });
-
-  expect(wrapper.html()).toMatchSnapshot();
-});

+ 13 - 9
src/packages/__VUE/popover/doc.md

@@ -229,19 +229,23 @@ export default {
 通过 location 属性来控制气泡的弹出位置。可选值
 ```
 top           # 顶部中间位置
-top-start     # 顶部左侧位置
-top-end       # 顶部右侧位置
 left          # 左侧中间位置
+right         # 右侧中间位置
+bottom        # 底部中间位置
+```
+自 `v3.1.21` 起新增
+```
+top-start     # 顶部左侧位置
+top-end       # 顶部右侧位置 
 left-start    # 左侧上方位置
 left-end      # 左侧下方位置
-right         # 右侧中间位置
 right-start   # 右侧上方位置
 right-end     # 右侧下方位置
-bottom        # 底部中间位置
 bottom-start  # 底部左侧位置
 bottom-end    # 底部右侧位置
 ```
 
+
 :::demo
 ```html
 <template>
@@ -286,10 +290,10 @@ export default {
 | list          | 选项列表                          | List[]   | []        |
 | visible      | 是否展示气泡弹出层                 | boolean  | false     |
 | theme          | 主题风格,可选值为 dark            | string   | `light`   |
-| location       | 弹出位置,可选值为 top,left,right  | string   | `bottom`  |
-| offset       | 出现位置的偏移量  | [number, number]   | [0, 12]  |
-| show-arrow       | 是否显示小箭头  | boolean  | true  |
-| custom-class       | 自定义 class 值  | string  | ''  |
+| location       | 弹出位置  | string   | `bottom`  |
+| offset `v3.1.21`       | 出现位置的偏移量  | [number, number]   | [0, 12]  |
+| show-arrow `v3.1.21`       | 是否显示小箭头  | boolean  | true  |
+| custom-class `v3.1.21`       | 自定义 class 值  | string  | ''  |
 
 ### List 数据结构  
 
@@ -300,7 +304,7 @@ List 属性是一个由对象构成的数组,数组中的每个对象配置一
 | name           | 选项文字               | string   | -      |
 | icon           | nut-icon 图标名称      | string   | -      |
 | disabled       | 是否为禁用状态          | boolean  | false  | 
-| className       | 为对应选项添加额外的类名          | string/Array/object  | -  | 
+| className `v3.1.21`      | 为对应选项添加额外的类名          | string/Array/object  | -  | 
 
 
 ### Slots