From 1134cf75e8b76625bc7818f8b6c4aed4c6382e64 Mon Sep 17 00:00:00 2001 From: huangriya Date: Tue, 17 Oct 2023 16:22:50 +0800 Subject: [PATCH] docs --- docs/404.html | 2 +- docs/api-examples.html | 2 +- ...64742.js => function_number.md.d47b266d.js} | 16 +++++++++++++--- ....js => function_number.md.d47b266d.lean.js} | 2 +- docs/components/react/scrollBar.html | 2 +- docs/components/vue/avGrid.html | 2 +- docs/components/vue/colorPicker.html | 2 +- docs/components/vue/column.html | 2 +- docs/components/vue/scrollBar.html | 2 +- docs/function/algorithm.html | 2 +- docs/function/array.html | 2 +- docs/function/browser.html | 2 +- docs/function/dataStructure.html | 2 +- docs/function/date.html | 2 +- docs/function/html.html | 2 +- docs/function/number.html | 18 ++++++++++++++---- docs/function/object.html | 2 +- docs/function/other.html | 2 +- docs/function/platform.html | 2 +- docs/function/regex.html | 2 +- docs/function/string.html | 2 +- docs/function/type.html | 2 +- docs/hashmap.json | 2 +- docs/index.html | 2 +- docs/markdown-examples.html | 2 +- package.json | 2 +- vitepress/function/number.md | 10 ++++++++++ 27 files changed, 61 insertions(+), 31 deletions(-) rename docs/assets/{function_number.md.aaa64742.js => function_number.md.d47b266d.js} (61%) rename docs/assets/{function_number.md.aaa64742.lean.js => function_number.md.d47b266d.lean.js} (67%) diff --git a/docs/404.html b/docs/404.html index c3bdb56..7dde084 100644 --- a/docs/404.html +++ b/docs/404.html @@ -13,7 +13,7 @@
Skip to content

404

PAGE NOT FOUND

But if you don't change your direction, and if you keep looking, you may end up where you are heading.
- + \ No newline at end of file diff --git a/docs/api-examples.html b/docs/api-examples.html index a991326..08ae417 100644 --- a/docs/api-examples.html +++ b/docs/api-examples.html @@ -156,7 +156,7 @@ }

Page Frontmatter

{
   "outline": "deep"
 }

More

Check out the documentation for the full list of runtime APIs.

- + \ No newline at end of file diff --git a/docs/assets/function_number.md.aaa64742.js b/docs/assets/function_number.md.d47b266d.js similarity index 61% rename from docs/assets/function_number.md.aaa64742.js rename to docs/assets/function_number.md.d47b266d.js index d2c3d63..b08a0cf 100644 --- a/docs/assets/function_number.md.aaa64742.js +++ b/docs/assets/function_number.md.d47b266d.js @@ -7,11 +7,21 @@ import{_ as s,o as a,c as n,R as l}from"./chunks/framework.b4504927.js";const F= random(100) // => 76 // 生成0到10之间的随机数,并保留两位小数 -random(0, 10, 2) // => 3.23

数字千分位

数字转换成货币格式

javascript
import { toCurrency } from 'lib-agile'
+random(0, 10, 2) // => 3.23

数字千分位

数字转换成货币格式

javascript
/**
+ * @param num 要处理的数字
+ * @param digits 保留几位小数
+ * @param isIntegerSet 整数是否处理小数逻辑
+ */
+
+import { toCurrency } from 'lib-agile'
 
 toCurrency(10000) // => 100,00
 
-toCurrency(10000.89) // => 100,00.89

数字差值

计算两个数的差值

javascript
import { diffCount } from 'lib-agile'
+toCurrency(10000, 1, true) // => 100,00.0
+
+toCurrency(10000.89) // => 100,00.89
+
+toCurrency(10000.893, 2) // => 100,00.89

数字差值

计算两个数的差值

javascript
import { diffCount } from 'lib-agile'
 
 diffCount(1000, 900) // => 100
 
@@ -19,4 +29,4 @@ import{_ as s,o as a,c as n,R as l}from"./chunks/framework.b4504927.js";const F=
 
 isOdd(1) // => true
 
-isOdd(2) // => false
`,12),t=[p];function e(c,r,i,y,C,D){return a(),n("div",null,t)}const d=s(o,[["render",e]]);export{F as __pageData,d as default}; +isOdd(2) // => false`,12),t=[p];function e(c,r,i,y,C,A){return a(),n("div",null,t)}const f=s(o,[["render",e]]);export{F as __pageData,f as default}; diff --git a/docs/assets/function_number.md.aaa64742.lean.js b/docs/assets/function_number.md.d47b266d.lean.js similarity index 67% rename from docs/assets/function_number.md.aaa64742.lean.js rename to docs/assets/function_number.md.d47b266d.lean.js index 722e007..64ed884 100644 --- a/docs/assets/function_number.md.aaa64742.lean.js +++ b/docs/assets/function_number.md.d47b266d.lean.js @@ -1 +1 @@ -import{_ as s,o as a,c as n,R as l}from"./chunks/framework.b4504927.js";const F=JSON.parse('{"title":"数字篇","description":"","frontmatter":{},"headers":[],"relativePath":"function/number.md","filePath":"function/number.md"}'),o={name:"function/number.md"},p=l("",12),t=[p];function e(c,r,i,y,C,D){return a(),n("div",null,t)}const d=s(o,[["render",e]]);export{F as __pageData,d as default}; +import{_ as s,o as a,c as n,R as l}from"./chunks/framework.b4504927.js";const F=JSON.parse('{"title":"数字篇","description":"","frontmatter":{},"headers":[],"relativePath":"function/number.md","filePath":"function/number.md"}'),o={name:"function/number.md"},p=l("",12),t=[p];function e(c,r,i,y,C,A){return a(),n("div",null,t)}const f=s(o,[["render",e]]);export{F as __pageData,f as default}; diff --git a/docs/components/react/scrollBar.html b/docs/components/react/scrollBar.html index ffd98a3..b7c98ff 100644 --- a/docs/components/react/scrollBar.html +++ b/docs/components/react/scrollBar.html @@ -55,7 +55,7 @@ ) } export default App;

api

props

参数说明类型默认值
type滚动类型。可选值为:show hover hidestringhover
minBarSize滚动条最小尺寸,x 轴滚动时宽度不小于这个值,y 轴滚动时高度不小于这个值number50
offsetLeftx 轴滚动条左边偏移量number0
offsetRightx 轴滚动条右边偏移量number10
offsetTopy 轴滚动条上边偏移量number0
offsetBottomy 轴滚动条下边偏移量number10

事件

事件名称说明回调参数
scroll滚动后触发function(scrollData, e)

方法

方法名称说明参数
updated默认情况下会监听子节点变动,但手动更改 dom 后导致的容器内容变更需要手动触发滚动组件更新updated()
setScrollLeft手动设置 x 轴滚动位置setScrollLeft(num: number)
setScrollTop手动设置 y 轴滚动位置setScrollTop(num: number)
- + \ No newline at end of file diff --git a/docs/components/vue/avGrid.html b/docs/components/vue/avGrid.html index 58fa5a1..988befa 100644 --- a/docs/components/vue/avGrid.html +++ b/docs/components/vue/avGrid.html @@ -16,7 +16,7 @@
Skip to content
On this page

均分网格

把容器平均分成 n 份,凡是需要平均排列的布局都可以用它来实现。

基本使用

api

props

参数说明类型默认值
num等分成多少份Number1
align对齐方式。可选值为:start center endstringstart
gutter边距Number, Array-
- + \ No newline at end of file diff --git a/docs/components/vue/colorPicker.html b/docs/components/vue/colorPicker.html index 30f7ea5..0919e65 100644 --- a/docs/components/vue/colorPicker.html +++ b/docs/components/vue/colorPicker.html @@ -16,7 +16,7 @@
Skip to content
On this page

颜色选择器

颜色选择

api

props

参数说明类型默认值
theme主题 light 或 darkstringlight
color当前选中颜色string#000000
quickColorsDefault快捷颜色默认列表Array['#000000']
- + \ No newline at end of file diff --git a/docs/components/vue/column.html b/docs/components/vue/column.html index 56fba14..c226b13 100644 --- a/docs/components/vue/column.html +++ b/docs/components/vue/column.html @@ -16,7 +16,7 @@
Skip to content
On this page

三栏布局

大部分布局其实都可以拆分成左中右、上中下或者左右、左中、上下、上中等等方式,该组件能很好的满足这些场景。

左中右布局

左边固定宽度,右边自适应宽度,中间余下宽度

固定宽度
自适应宽度

左右布局

左边固定宽度,右边自适应宽度

固定宽度
自适应宽度

api

props

参数说明类型默认值
align对齐方式。可选值为:start center endstringstart
vertical垂直排列Booleanfalse
- + \ No newline at end of file diff --git a/docs/components/vue/scrollBar.html b/docs/components/vue/scrollBar.html index cad18bd..ac09c06 100644 --- a/docs/components/vue/scrollBar.html +++ b/docs/components/vue/scrollBar.html @@ -47,7 +47,7 @@ import scrollBar from 'lib-agile/es/components/scrollBar/index.vue.js' import 'lib-agile/es/components/scrollBar/index.css' </script>

api

props

参数说明类型默认值
type滚动类型。可选值为:show hover hidestringhover
minBarSize滚动条最小尺寸,x 轴滚动时宽度不小于这个值,y 轴滚动时高度不小于这个值number50
offsetLeftx 轴滚动条左边偏移量number0
offsetRightx 轴滚动条右边偏移量number10
offsetTopy 轴滚动条上边偏移量number0
offsetBottomy 轴滚动条下边偏移量number10
isAutoUpdate容器内内容变更是否自动更新滚动条Booleantrue

事件

事件名称说明回调参数
scroll滚动后触发function(scrollData, e)

方法

方法名称说明参数
updatedisAutoUpdate 等于 false 时,容器内容变更后可以手动触发滚动组件更新updated()
setScrollLeft手动设置 x 轴滚动位置setScrollLeft(num: number)
setScrollTop手动设置 y 轴滚动位置setScrollTop(num: number)
- + \ No newline at end of file diff --git a/docs/function/algorithm.html b/docs/function/algorithm.html index b4e5f63..31becb8 100644 --- a/docs/function/algorithm.html +++ b/docs/function/algorithm.html @@ -139,7 +139,7 @@ shuffle(arr) // 随机排列该数组 console.log(arr) - + \ No newline at end of file diff --git a/docs/function/array.html b/docs/function/array.html index 8f2cb3e..29efc42 100644 --- a/docs/function/array.html +++ b/docs/function/array.html @@ -85,7 +85,7 @@ delArrItem(arr, { id: 1, name: 'a' }) // => [{id: 1, name: 'b'},{id: 1, name: 'c'},{id: 2, name: 'd'}] delArrItem([1, 2, 2, 4, 5], 2) // => [1, 4, 5] - + \ No newline at end of file diff --git a/docs/function/browser.html b/docs/function/browser.html index 7667e3c..c7a2284 100644 --- a/docs/function/browser.html +++ b/docs/function/browser.html @@ -41,7 +41,7 @@ } }) } - + \ No newline at end of file diff --git a/docs/function/dataStructure.html b/docs/function/dataStructure.html index 3e8b770..706c87d 100644 --- a/docs/function/dataStructure.html +++ b/docs/function/dataStructure.html @@ -171,7 +171,7 @@ ] arrToMap(arr, 'id') // => {1: {id: 1, name: a}, 2: {id: 2}} - + \ No newline at end of file diff --git a/docs/function/date.html b/docs/function/date.html index fd99daa..5177d8c 100644 --- a/docs/function/date.html +++ b/docs/function/date.html @@ -16,7 +16,7 @@
- + \ No newline at end of file diff --git a/docs/function/html.html b/docs/function/html.html index 10872c6..efa4c0b 100644 --- a/docs/function/html.html +++ b/docs/function/html.html @@ -24,7 +24,7 @@ htmlParser('<div>123</div>') // => #document

html 标签转换成安全字符

javascript
import { escapeHtml } from 'lib-agile'
 
 escapeHtml('<div>123</div>') // => #&lt;div&gt;123&lt;/div&gt;
- + \ No newline at end of file diff --git a/docs/function/number.html b/docs/function/number.html index 484d187..3439d64 100644 --- a/docs/function/number.html +++ b/docs/function/number.html @@ -11,7 +11,7 @@ - + @@ -24,11 +24,21 @@ random(100) // => 76 // 生成0到10之间的随机数,并保留两位小数 -random(0, 10, 2) // => 3.23

数字千分位

数字转换成货币格式

javascript
import { toCurrency } from 'lib-agile'
+random(0, 10, 2) // => 3.23

数字千分位

数字转换成货币格式

javascript
/**
+ * @param num 要处理的数字
+ * @param digits 保留几位小数
+ * @param isIntegerSet 整数是否处理小数逻辑
+ */
+
+import { toCurrency } from 'lib-agile'
 
 toCurrency(10000) // => 100,00
 
-toCurrency(10000.89) // => 100,00.89

数字差值

计算两个数的差值

javascript
import { diffCount } from 'lib-agile'
+toCurrency(10000, 1, true) // => 100,00.0
+
+toCurrency(10000.89) // => 100,00.89
+
+toCurrency(10000.893, 2) // => 100,00.89

数字差值

计算两个数的差值

javascript
import { diffCount } from 'lib-agile'
 
 diffCount(1000, 900) // => 100
 
@@ -37,7 +47,7 @@
 isOdd(1) // => true
 
 isOdd(2) // => false
- + \ No newline at end of file diff --git a/docs/function/object.html b/docs/function/object.html index 10cfb95..2ae5c64 100644 --- a/docs/function/object.html +++ b/docs/function/object.html @@ -27,7 +27,7 @@ } mergeIntersect(source, target) // => {a: 2} - + \ No newline at end of file diff --git a/docs/function/other.html b/docs/function/other.html index c4c830b..4717247 100644 --- a/docs/function/other.html +++ b/docs/function/other.html @@ -22,7 +22,7 @@ blocked(5000) // 阻塞程序5秒 console.log('我会在5秒后输出') - + \ No newline at end of file diff --git a/docs/function/platform.html b/docs/function/platform.html index 4963179..dd9872c 100644 --- a/docs/function/platform.html +++ b/docs/function/platform.html @@ -16,7 +16,7 @@
- + \ No newline at end of file diff --git a/docs/function/regex.html b/docs/function/regex.html index 398c2cd..be3d39b 100644 --- a/docs/function/regex.html +++ b/docs/function/regex.html @@ -16,7 +16,7 @@
- + \ No newline at end of file diff --git a/docs/function/string.html b/docs/function/string.html index 4cda47d..35520e9 100644 --- a/docs/function/string.html +++ b/docs/function/string.html @@ -24,7 +24,7 @@ randomIp() //ipv4 randomIp(1) //ipv6 - + \ No newline at end of file diff --git a/docs/function/type.html b/docs/function/type.html index d172f03..5c9dddf 100644 --- a/docs/function/type.html +++ b/docs/function/type.html @@ -28,7 +28,7 @@ isPromise(5) // => false isPromise(new Promise(() => {})) // => true - + \ No newline at end of file diff --git a/docs/hashmap.json b/docs/hashmap.json index 28722c3..3221676 100644 --- a/docs/hashmap.json +++ b/docs/hashmap.json @@ -1 +1 @@ -{"components_vue_avgrid.md":"a9366c1e","components_vue_colorpicker.md":"8460dcde","api-examples.md":"a7a4ac0d","components_react_scrollbar.md":"0ab54dc4","components_vue_scrollbar.md":"655a6dc1","function_browser.md":"418de8e5","function_algorithm.md":"bef1175b","components_vue_column.md":"f95b1f3b","function_array.md":"b1fb4c82","function_datastructure.md":"bfce568f","function_date.md":"e0704192","function_html.md":"582c9688","function_object.md":"488ac1e9","function_number.md":"aaa64742","function_other.md":"3411fe67","function_regex.md":"b8fc2d30","function_platform.md":"ecb83a3e","function_string.md":"04ff1f39","function_type.md":"ec8d5fbe","index.md":"3c3c07ca","markdown-examples.md":"051d8b49"} +{"components_vue_colorpicker.md":"8460dcde","components_vue_avgrid.md":"a9366c1e","function_object.md":"488ac1e9","function_type.md":"ec8d5fbe","function_browser.md":"418de8e5","function_platform.md":"ecb83a3e","function_date.md":"e0704192","function_number.md":"d47b266d","function_datastructure.md":"bfce568f","index.md":"3c3c07ca","function_array.md":"b1fb4c82","function_algorithm.md":"bef1175b","function_regex.md":"b8fc2d30","api-examples.md":"a7a4ac0d","components_react_scrollbar.md":"0ab54dc4","function_string.md":"04ff1f39","markdown-examples.md":"051d8b49","components_vue_column.md":"f95b1f3b","function_other.md":"3411fe67","function_html.md":"582c9688","components_vue_scrollbar.md":"655a6dc1"} diff --git a/docs/index.html b/docs/index.html index 0ce2e88..2e31d22 100644 --- a/docs/index.html +++ b/docs/index.html @@ -16,7 +16,7 @@
Skip to content

libAgile

简单 方便 快捷

让写代码更快,让bug更少

- + \ No newline at end of file diff --git a/docs/markdown-examples.html b/docs/markdown-examples.html index c951dac..41a8a46 100644 --- a/docs/markdown-examples.html +++ b/docs/markdown-examples.html @@ -48,7 +48,7 @@ ::: details This is a details block. :::

Output

INFO

This is an info box.

TIP

This is a tip.

WARNING

This is a warning.

DANGER

This is a dangerous warning.

Details

This is a details block.

More

Check out the documentation for the full list of markdown extensions.

- + \ No newline at end of file diff --git a/package.json b/package.json index 1591f13..3071284 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lib-agile", - "version": "1.0.0-beta.15", + "version": "1.0.0-beta.17", "description": "简单方便快捷的综合库,包含工具函数、组件、样式,与第三方组件库形式优势互补。", "type": "module", "main": "./dist/lib-agile.umd.js", diff --git a/vitepress/function/number.md b/vitepress/function/number.md index 5d893cf..e9d717a 100644 --- a/vitepress/function/number.md +++ b/vitepress/function/number.md @@ -22,11 +22,21 @@ random(0, 10, 2) // => 3.23 数字转换成货币格式 ```javascript +/** + * @param num 要处理的数字 + * @param digits 保留几位小数 + * @param isIntegerSet 整数是否处理小数逻辑 + */ + import { toCurrency } from 'lib-agile' toCurrency(10000) // => 100,00 +toCurrency(10000, 1, true) // => 100,00.0 + toCurrency(10000.89) // => 100,00.89 + +toCurrency(10000.893, 2) // => 100,00.89 ``` ## 数字差值