浏览代码

fix: barrage, countup文档修改

Ymm0008 3 年之前
父节点
当前提交
f7ff71b131

+ 13 - 13
src/packages/__VUE/barrage/doc.en-US.md

@@ -25,7 +25,7 @@ app.use(Barrage);
 <template>
 <template>
   <nut-barrage ref="danmu" :danmu="list"></nut-barrage>
   <nut-barrage ref="danmu" :danmu="list"></nut-barrage>
   <div class="test">
   <div class="test">
-    <button @click="addDanmu" class="add nut-button--primary">随机添加</button>
+    <button @click="addDanmu" class="add nut-button--primary">add randomly</button>
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>
@@ -35,10 +35,10 @@ export default {
   setup() {
   setup() {
     const inputVal = ref('');
     const inputVal = ref('');
     const danmu = ref(null);
     const danmu = ref(null);
-    let list = ref(['画美不看', '不明觉厉', '喜大普奔', '男默女泪', '累觉不爱', '爷青结-']);
+    let list = ref(['aaaa', 'bbbb', 'cccc', 'dddd', 'eeee', 'ffff']);
     function addDanmu() {
     function addDanmu() {
       let n = Math.random();
       let n = Math.random();
-      danmu.value.add('随机——' + String(n).substr(2, 10));
+      danmu.value.add('randomly——' + String(n).substr(2, 10));
     }
     }
     return {
     return {
       inputVal,
       inputVal,
@@ -77,17 +77,17 @@ export default {
 
 
 ### Props
 ### Props
 
 
-| Attribute | Description | Type   | Default |
-|--------------|----------------------------------|--------|------------------|
-| danmu         | Barrage list data               | Array | []              |
-| frequency        | The time interval between the occurrence of each barrage in the visual area    | Number | 500               |
-| speeds         | Rolling time of each barrage | Number |  2000               |
-| rows  | The number of bullet screen lines is displayed in several lines    | Number | 1 |
-| top  | Vertical distance of barrage    | Number | 10 |
-| loop  | Loop play     | Boolean | true |
+| Parameter | Description | Type | Default |
+|--------------|---------------------------------- |-------|------------------|
+| danmu | Danmaku list data | Array | `[]` |
+| frequency | the time interval of each barrage in the visible area | number | `500` |
+| speeds | scrolling time of each barrage | number | `2000` |
+| rows | Number of bullet chatting lines, displayed in several lines | number | `1` |
+| top | vertical distance of the barrage | number | `10` |
+| loop | Whether to play in a loop | boolean | `true` |
 
 
 ### Events
 ### Events
 
 
-| 事件名 | 说明           | 回调参数     |
+| Event Name | Description | Callback Parameters |
 |--------|----------------|--------------|
 |--------|----------------|--------------|
-| add  | Add data | - |
+| add | add data | `-` |

+ 7 - 7
src/packages/__VUE/barrage/doc.md

@@ -79,15 +79,15 @@ export default {
 
 
 | 参数         | 说明                             | 类型   | 默认值           |
 | 参数         | 说明                             | 类型   | 默认值           |
 |--------------|----------------------------------|--------|------------------|
 |--------------|----------------------------------|--------|------------------|
-| danmu         | 弹幕列表数据               | Array | []              |
-| frequency        | 可视区域内每个弹幕出现的时间间隔                         | Number | 500               |
-| speeds         | 每个弹幕的滚动时间 | Number |  2000               |
-| rows  | 弹幕行数,分几行展示     | Number | 1 |
-| top  | 弹幕垂直距离    | Number | 10 |
-| loop  | 是否循环播放     | Boolean | true |
+| danmu         | 弹幕列表数据               | Array | `[]`              |
+| frequency        | 可视区域内每个弹幕出现的时间间隔                         | number | `500`               |
+| speeds         | 每个弹幕的滚动时间 | number |  `2000`               |
+| rows  | 弹幕行数,分几行展示     | number | `1` |
+| top  | 弹幕垂直距离    | number | `10` |
+| loop  | 是否循环播放     | boolean | `true` |
 
 
 ### Events
 ### Events
 
 
 | 事件名 | 说明           | 回调参数     |
 | 事件名 | 说明           | 回调参数     |
 |--------|----------------|--------------|
 |--------|----------------|--------------|
-| add  | 添加数据 | - |
+| add  | 添加数据 | `-` |

+ 8 - 7
src/packages/__VUE/barrage/doc.taro.md

@@ -77,17 +77,18 @@ export default {
 
 
 ### Props
 ### Props
 
 
+
 | 参数         | 说明                             | 类型   | 默认值           |
 | 参数         | 说明                             | 类型   | 默认值           |
 |--------------|----------------------------------|--------|------------------|
 |--------------|----------------------------------|--------|------------------|
-| danmu         | 弹幕列表数据               | Array | []              |
-| frequency        | 可视区域内每个弹幕出现的时间间隔                         | Number | 500               |
-| speeds         | 每个弹幕的滚动时间 | Number |  2000               |
-| rows  | 弹幕行数,分几行展示     | Number | 1 |
-| top  | 弹幕垂直距离    | Number | 10 |
-| loop  | 是否循环播放     | Boolean | true |
+| danmu         | 弹幕列表数据               | Array | `[]`              |
+| frequency        | 可视区域内每个弹幕出现的时间间隔                         | number | `500`               |
+| speeds         | 每个弹幕的滚动时间 | number |  `2000`               |
+| rows  | 弹幕行数,分几行展示     | number | `1` |
+| top  | 弹幕垂直距离    | number | `10` |
+| loop  | 是否循环播放     | boolean | `true` |
 
 
 ### Events
 ### Events
 
 
 | 事件名 | 说明           | 回调参数     |
 | 事件名 | 说明           | 回调参数     |
 |--------|----------------|--------------|
 |--------|----------------|--------------|
-| add  | 添加数据 | - |
+| add  | 添加数据 | `-` |

+ 24 - 27
src/packages/__VUE/countup/doc.en-US.md

@@ -140,36 +140,33 @@ export default {
 ## API
 ## API
 ### Props
 ### Props
 
 
-| Attribute | Description | Type   | Default |
-|----- | ----- | ----- | ----- 
-| init-num | Initial number | Number | 0
-| end-num | End number | Number | 0
-| speed | Interval number. At present, only basic usage is supported | Number | 1
-| to-fixed | Keep several decimal places | Number | The incoming number shall prevail
-| start-flag | Identification that triggers digital scrolling | Boolean | true
-| during | Scroll one run time | Number | 1000
-| num-width | Digital width, often used to customize seamless scrolling | Number | 20
-| num-height | Digital height, commonly used to customize seamless scrolling (lottery function is required) | Number | 20
-| scrolling | For digital scrolling display | Boolean | false
-| custom | Digital scrolling for custom pictures | Boolean | false
-| custom-change-num | Number to change (for custom pictures, initnum \ endnum is invalid here) | Number | 1
-| custom-bg-img | Custom picture (it is recommended to use sprite chart, and Sprite chart must be used when using lottery function) | - | -
-| custom-spac-num | There may be a gap between the numbers in the picture | Number | 0
-| type | "Machine" must be passed when using the lottery function | string | ''
-| machine-prize-num | The number of prizes and the total number of prizes must be passed on | number | 4
-| machine-num | Lucky draw, that is, rolling a few, must be passed | number | 3
-| machine-prize-level | Winning icon, the position of the icon in sprite chart | number | 0
-| machine-turn-more | Number of rolling turns | number | 0
-
-> Note: the lottery function needs to be calculated in combination with the icon position, so the height num height of a single icon in sprite chart needs to be input; The winning prize is located according to the number of prize digits in sprite chart, from 1 to n;
-
-
-
+| Field | Description | Type | Default
+|----- | ----- | ----- | -----
+| init-num | initial number | number | `0`
+| end-num | end number | number | `0`
+| speed | interval number, currently only supports basic usage | number | `1`
+| to-fixed | retain the number of decimal places | number | `subject to the number passed in`
+| start-flag | flag to trigger number scrolling | boolean | `true`
+| during | rolling time to run | number | `1000`
+| num-width | Number width, often used to customize seamless scrolling | number | `20`
+| num-height | Number height, often used to customize seamless scrolling (required for lottery function) | number | `20`
+| scrolling | used for numeric scrolling display | boolean | `false`
+| custom | for custom image scrolling | boolean | `false`
+| custom-change-num | The number to change (for custom pictures, initNum and endNum are invalid here) | number | `1`
+| custom-bg-img | Custom image (it is recommended to use Sprite image, and Sprite image must be used to use the lottery function) | - | `-`
+| custom-spac-num | There may be space between numbers in the image | number | `0`
+| type | "machine" must be passed when using the lottery function | string | `''`
+| machine-prize-num | Number of prizes, how many prizes in total, must be passed | number | `4`
+| machine-num | lottery position, that is, how many times to roll, must pass | number | `3`
+| machine-prize-level | The winning icon, the position of the icon in the sprite image | number | `0`
+| machine-turn-more | number of turns | number | `0`
+
+> Note: The lottery function needs to be calculated in conjunction with the position of the icon, so the height num-height of a single icon in the sprite image needs to be passed in; the winning prize is positioned according to the number of prizes in the sprite image, from 1 to N;
 
 
 
 
 ### Events
 ### Events
 
 
-| Event | Description   | Arguments   |
+| field | description | callback parameter
 |----- | ----- | -----
 |----- | ----- | -----
-| scroll-end | Callback function after scrolling | - 
+| scroll-end | callback function after scrolling ends | `-`
     
     

+ 19 - 22
src/packages/__VUE/countup/doc.md

@@ -141,34 +141,31 @@ export default {
 
 
 | 字段 | 说明 | 类型 | 默认值
 | 字段 | 说明 | 类型 | 默认值
 |----- | ----- | ----- | ----- 
 |----- | ----- | ----- | ----- 
-| init-num | 初始数字 | Number | 0
-| end-num | 结束数字 | Number | 0
-| speed | 间隔数字,目前仅支持基本用法 | Number | 1
-| to-fixed | 保留小数点后几位 | Number | 以传入的数字为准
-| start-flag | 触发数字滚动的标识 | Boolean | true
-| during | 滚动一次运行时间 | Number | 1000
-| num-width | 数字宽度,常用于自定义无缝滚动 | Number | 20
-| num-height | 数字高度,常用于自定义无缝滚动(抽奖功能必传) | Number | 20
-| scrolling | 用于数字滚动展示 | Boolean | false
-| custom | 用于自定义图片数字滚动 | Boolean | false
-| custom-change-num | 要变化的数字(用于自定义图片,initNum\endNum在此无效) | Number | 1
-| custom-bg-img | 自定义图片(建议使用雪碧图实现,使用抽奖功能必须使用雪碧图) | - | -
-| custom-spac-num | 图片中数字之间可能会存在间距 | Number | 0
-| type | 使用抽奖功能必传“machine” | string | ''
-| machine-prize-num | 奖品个数,一共多少个奖品,必传 | number | 4
-| machine-num | 抽奖位,即滚动几个,必传 | number | 3
-| machine-prize-level | 中奖图标,图标在雪碧图中的位置 | number | 0
-| machine-turn-more | 滚动圈数 | number | 0
+| init-num | 初始数字 | number | `0`
+| end-num | 结束数字 | number | `0`
+| speed | 间隔数字,目前仅支持基本用法 | number | `1`
+| to-fixed | 保留小数点后几位 | number | `以传入的数字为准`
+| start-flag | 触发数字滚动的标识 | boolean | `true`
+| during | 滚动一次运行时间 | number | `1000`
+| num-width | 数字宽度,常用于自定义无缝滚动 | number | `20`
+| num-height | 数字高度,常用于自定义无缝滚动(抽奖功能必传) | number | `20`
+| scrolling | 用于数字滚动展示 | boolean | `false`
+| custom | 用于自定义图片数字滚动 | boolean | `false`
+| custom-change-num | 要变化的数字(用于自定义图片,initNum、endNum在此无效) | number | `1`
+| custom-bg-img | 自定义图片(建议使用雪碧图实现,使用抽奖功能必须使用雪碧图) | - | `-`
+| custom-spac-num | 图片中数字之间可能会存在间距 | number | `0`
+| type | 使用抽奖功能必传"machine" | string | `''`
+| machine-prize-num | 奖品个数,一共多少个奖品,必传 | number | `4`
+| machine-num | 抽奖位,即滚动几个,必传 | number | `3`
+| machine-prize-level | 中奖图标,图标在雪碧图中的位置 | number | `0`
+| machine-turn-more | 滚动圈数 | number | `0`
 
 
 > 说明:抽奖功能需要结合图标位置计算,故需传入雪碧图中单个图标的高度 num-height;中奖奖品根据雪碧图中的奖品位数来定位,从 1 到 N;
 > 说明:抽奖功能需要结合图标位置计算,故需传入雪碧图中单个图标的高度 num-height;中奖奖品根据雪碧图中的奖品位数来定位,从 1 到 N;
 
 
 
 
-
-
-
 ### Events
 ### Events
 
 
 | 字段 | 说明 | 回调参数
 | 字段 | 说明 | 回调参数
 |----- | ----- | -----
 |----- | ----- | -----
-| scroll-end | 滚动结束后回调函数 | - 
+| scroll-end | 滚动结束后回调函数 | `-`
     
     

+ 20 - 22
src/packages/__VUE/countup/doc.taro.md

@@ -137,38 +137,36 @@ export default {
 :::
 :::
 
 
 ## API
 ## API
+
 ### Props
 ### Props
 
 
 | 字段 | 说明 | 类型 | 默认值
 | 字段 | 说明 | 类型 | 默认值
 |----- | ----- | ----- | ----- 
 |----- | ----- | ----- | ----- 
-| init-num | 初始数字 | Number | 0
-| end-num | 结束数字 | Number | 0
-| speed | 间隔数字,目前仅支持基本用法 | Number | 1
-| to-fixed | 保留小数点后几位 | Number | 以传入的数字为准
-| start-flag | 触发数字滚动的标识 | Boolean | true
-| during | 滚动一次运行时间 | Number | 1000
-| num-width | 数字宽度,常用于自定义无缝滚动 | Number | 20
-| num-height | 数字高度,常用于自定义无缝滚动(抽奖功能必传) | Number | 20
-| scrolling | 用于数字滚动展示 | Boolean | false
-| custom | 用于自定义图片数字滚动 | Boolean | false
-| custom-change-num | 要变化的数字(用于自定义图片,initNum\endNum在此无效) | Number | 1
-| custom-bg-img | 自定义图片(建议使用雪碧图实现,使用抽奖功能必须使用雪碧图) | - | -
-| custom-spac-num | 图片中数字之间可能会存在间距 | Number | 0
-| type | 使用抽奖功能必传“machine” | string | ''
-| machine-prize-num | 奖品个数,一共多少个奖品,必传 | number | 4
-| machine-num | 抽奖位,即滚动几个,必传 | number | 3
-| machine-prize-level | 中奖图标,图标在雪碧图中的位置 | number | 0
-| machine-turn-more | 滚动圈数 | number | 0
+| init-num | 初始数字 | number | `0`
+| end-num | 结束数字 | number | `0`
+| speed | 间隔数字,目前仅支持基本用法 | number | `1`
+| to-fixed | 保留小数点后几位 | number | `以传入的数字为准`
+| start-flag | 触发数字滚动的标识 | boolean | `true`
+| during | 滚动一次运行时间 | number | `1000`
+| num-width | 数字宽度,常用于自定义无缝滚动 | number | `20`
+| num-height | 数字高度,常用于自定义无缝滚动(抽奖功能必传) | number | `20`
+| scrolling | 用于数字滚动展示 | boolean | `false`
+| custom | 用于自定义图片数字滚动 | boolean | `false`
+| custom-change-num | 要变化的数字(用于自定义图片,initNum、endNum在此无效) | number | `1`
+| custom-bg-img | 自定义图片(建议使用雪碧图实现,使用抽奖功能必须使用雪碧图) | - | `-`
+| custom-spac-num | 图片中数字之间可能会存在间距 | number | `0`
+| type | 使用抽奖功能必传"machine" | string | `''`
+| machine-prize-num | 奖品个数,一共多少个奖品,必传 | number | `4`
+| machine-num | 抽奖位,即滚动几个,必传 | number | `3`
+| machine-prize-level | 中奖图标,图标在雪碧图中的位置 | number | `0`
+| machine-turn-more | 滚动圈数 | number | `0`
 
 
 > 说明:抽奖功能需要结合图标位置计算,故需传入雪碧图中单个图标的高度 num-height;中奖奖品根据雪碧图中的奖品位数来定位,从 1 到 N;
 > 说明:抽奖功能需要结合图标位置计算,故需传入雪碧图中单个图标的高度 num-height;中奖奖品根据雪碧图中的奖品位数来定位,从 1 到 N;
 
 
 
 
-
-
-
 ### Events
 ### Events
 
 
 | 字段 | 说明 | 回调参数
 | 字段 | 说明 | 回调参数
 |----- | ----- | -----
 |----- | ----- | -----
-| scroll-end | 滚动结束后回调函数 | - 
+| scroll-end | 滚动结束后回调函数 | `-`