jobsys-explore 4.0.16 → 4.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/.changeset/README.md +8 -8
  2. package/.changeset/config.json +11 -11
  3. package/.changeset/{healthy-candles-wink.md → hip-hounds-drop.md} +1 -1
  4. package/.changeset/{blue-bees-fix.md → hip-spoons-smell.md} +1 -1
  5. package/.eslintignore +3 -3
  6. package/.eslintrc.cjs +37 -37
  7. package/.prettierrc.cjs +38 -38
  8. package/CHANGELOG.md +28 -0
  9. package/README.md +41 -41
  10. package/TODOs.md +8 -8
  11. package/components/button/ExButton.jsx +120 -120
  12. package/components/button/index.js +4 -4
  13. package/components/button/index.less +7 -7
  14. package/components/decorator/ExDecorator.jsx +31 -31
  15. package/components/decorator/index.js +5 -5
  16. package/components/decorator/index.less +76 -76
  17. package/components/form/ExAddress.jsx +195 -195
  18. package/components/form/ExCascader.jsx +174 -174
  19. package/components/form/ExCheckbox.jsx +59 -59
  20. package/components/form/ExDate.jsx +129 -129
  21. package/components/form/ExDatetime.jsx +148 -148
  22. package/components/form/ExField.jsx +132 -132
  23. package/components/form/ExFieldUploader.jsx +50 -50
  24. package/components/form/ExForm.jsx +438 -438
  25. package/components/form/ExNumber.jsx +51 -51
  26. package/components/form/ExRadio.jsx +58 -58
  27. package/components/form/ExRate.jsx +51 -51
  28. package/components/form/ExSelect.jsx +146 -146
  29. package/components/form/ExSlider.jsx +55 -55
  30. package/components/form/ExSwitch.jsx +51 -51
  31. package/components/form/ExTime.jsx +99 -99
  32. package/components/form/FormItem.jsx +263 -263
  33. package/components/form/PickerWrapper.jsx +120 -120
  34. package/components/form/index.js +44 -44
  35. package/components/form/index.less +134 -134
  36. package/components/form/utils.js +52 -52
  37. package/components/grid/ExGrid.jsx +53 -53
  38. package/components/grid/index.js +4 -4
  39. package/components/grid/index.less +2 -2
  40. package/components/index.js +12 -12
  41. package/components/pagination/ExPagination.jsx +264 -264
  42. package/components/pagination/index.js +5 -5
  43. package/components/provider/ExProvider.jsx +173 -173
  44. package/components/provider/index.js +4 -4
  45. package/components/qrcode/ExQrcode.jsx +86 -86
  46. package/components/qrcode/index.js +5 -5
  47. package/components/qrcode/index.less +8 -8
  48. package/components/result/ExResult.jsx +122 -122
  49. package/components/result/index.js +5 -5
  50. package/components/result/index.less +59 -59
  51. package/components/search/ExSearch.jsx +290 -290
  52. package/components/search/components/Expand.jsx +77 -77
  53. package/components/search/components/Field.jsx +27 -27
  54. package/components/search/components/Quick.jsx +53 -53
  55. package/components/search/components/index.js +5 -5
  56. package/components/search/index.js +5 -5
  57. package/components/search/index.less +118 -118
  58. package/components/search/utils.js +30 -30
  59. package/components/sector/ExSector.jsx +52 -52
  60. package/components/sector/README.md +26 -26
  61. package/components/sector/index.js +5 -5
  62. package/components/sector/index.less +122 -122
  63. package/components/theme/ExTheme.jsx +10 -10
  64. package/components/theme/index.js +4 -4
  65. package/components/theme/index.less +98 -98
  66. package/components/uploader/ExUploader.jsx +260 -260
  67. package/components/uploader/index.js +5 -5
  68. package/components/utils.js +187 -187
  69. package/dist/hooks.cjs +1 -1
  70. package/dist/hooks.cjs.map +1 -1
  71. package/dist/hooks.js +16 -15
  72. package/dist/hooks.js.map +1 -1
  73. package/dist/index-4faac98c.cjs +2 -0
  74. package/dist/index-4faac98c.cjs.map +1 -0
  75. package/dist/{index-183ff5ec.js → index-714497da.js} +171 -153
  76. package/dist/index-714497da.js.map +1 -0
  77. package/dist/jobsys-explore.cjs +1 -1
  78. package/dist/jobsys-explore.cjs.map +1 -1
  79. package/dist/jobsys-explore.js +5 -5
  80. package/dist/jobsys-explore.js.map +1 -1
  81. package/docgen.config.js +15 -15
  82. package/docs/.vuepress/config.js +61 -61
  83. package/docs/.vuepress/styles/index.scss +7 -7
  84. package/docs/components/sector/ExSector.md +43 -43
  85. package/docs/index.md +82 -82
  86. package/hooks/cipher.js +44 -44
  87. package/hooks/datetime.js +63 -63
  88. package/hooks/form.js +190 -190
  89. package/hooks/index.js +5 -5
  90. package/hooks/network.js +122 -122
  91. package/hooks/utils.js +226 -192
  92. package/index.html +17 -17
  93. package/index.js +26 -26
  94. package/package.json +1 -1
  95. package/playground/App.vue +94 -94
  96. package/playground/TestButton.vue +61 -40
  97. package/playground/TestCascader.vue +2441 -2441
  98. package/playground/TestDecorator.vue +14 -14
  99. package/playground/TestForm.vue +369 -369
  100. package/playground/TestFormItem.vue +110 -110
  101. package/playground/TestGrid.vue +22 -22
  102. package/playground/TestPagination.vue +1211 -1211
  103. package/playground/TestQrcode.vue +7 -7
  104. package/playground/TestResult.vue +12 -12
  105. package/playground/TestSearch.vue +97 -97
  106. package/playground/TestSector.vue +15 -15
  107. package/playground/TestUploader.vue +9 -9
  108. package/playground/http.js +23 -23
  109. package/playground/main.js +22 -22
  110. package/postcss.config.cjs +8 -8
  111. package/utils/style.js +13 -13
  112. package/utils/withInstall.js +7 -7
  113. package/vite.config.js +53 -53
  114. package/.changeset/itchy-months-grow.md +0 -5
  115. package/.changeset/mean-rice-repeat.md +0 -5
  116. package/.changeset/modern-clocks-notice.md +0 -5
  117. package/.changeset/nasty-socks-watch.md +0 -5
  118. package/.changeset/nice-seahorses-visit.md +0 -5
  119. package/.changeset/olive-roses-sing.md +0 -5
  120. package/.changeset/orange-olives-reply.md +0 -5
  121. package/.changeset/perfect-laws-warn.md +0 -5
  122. package/.changeset/quiet-chairs-rhyme.md +0 -5
  123. package/.changeset/rich-points-bake.md +0 -5
  124. package/.changeset/serious-sloths-smoke.md +0 -5
  125. package/.changeset/tasty-bottles-build.md +0 -5
  126. package/.changeset/twenty-laws-melt.md +0 -5
  127. package/dist/index-183ff5ec.js.map +0 -1
  128. package/dist/index-913186e2.cjs +0 -2
  129. package/dist/index-913186e2.cjs.map +0 -1
@@ -1,8 +1,8 @@
1
- # Changesets
2
-
3
- Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4
- with multi-package repos, or single-package repos to help you version and publish your code. You can
5
- find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6
-
7
- We have a quick list of common questions to get you started engaging with this project in
8
- [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
1
+ # Changesets
2
+
3
+ Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4
+ with multi-package repos, or single-package repos to help you version and publish your code. You can
5
+ find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6
+
7
+ We have a quick list of common questions to get you started engaging with this project in
8
+ [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
@@ -1,11 +1,11 @@
1
- {
2
- "$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json",
3
- "changelog": "@changesets/cli/changelog",
4
- "commit": false,
5
- "fixed": [],
6
- "linked": [],
7
- "access": "public",
8
- "baseBranch": "master",
9
- "updateInternalDependencies": "patch",
10
- "ignore": []
11
- }
1
+ {
2
+ "$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json",
3
+ "changelog": "@changesets/cli/changelog",
4
+ "commit": false,
5
+ "fixed": [],
6
+ "linked": [],
7
+ "access": "public",
8
+ "baseBranch": "master",
9
+ "updateInternalDependencies": "patch",
10
+ "ignore": []
11
+ }
@@ -2,4 +2,4 @@
2
2
  "jobsys-explore": patch
3
3
  ---
4
4
 
5
- y
5
+ Add useFindOptionByValue
@@ -2,4 +2,4 @@
2
2
  "jobsys-explore": patch
3
3
  ---
4
4
 
5
- address
5
+ Upgrade
package/.eslintignore CHANGED
@@ -1,4 +1,4 @@
1
- dist
2
- node_modules
3
- .prettierrc.cjs
1
+ dist
2
+ node_modules
3
+ .prettierrc.cjs
4
4
  vite.config.js
package/.eslintrc.cjs CHANGED
@@ -1,38 +1,38 @@
1
- module.exports = {
2
- env: {
3
- browser: true,
4
- es2021: true
5
- },
6
- globals: {
7
- defineOptions: true
8
- },
9
- extends: ["eslint-config-prettier", "plugin:import/recommended", "eslint:recommended", "plugin:vue/vue3-recommended", "plugin:prettier/recommended"],
10
- overrides: [],
11
- parserOptions: {
12
- ecmaVersion: "latest",
13
- sourceType: "module",
14
- ecmaFeatures: {
15
- jsx: true
16
- }
17
- },
18
- plugins: ["vue"],
19
- rules: {
20
- "import/prefer-default-export": "off",
21
- "import/no-extraneous-dependencies": "off",
22
- "import/no-duplicates": "off",
23
- "import/named": "off",
24
- "import/order": "off",
25
- "import/first": "off",
26
- "vue/attributes-order": "off",
27
- "vue/no-mutating-props": "off",
28
- "vue/no-reserved-component-names": "off",
29
- "vue/no-v-html": "off",
30
- "no-param-reassign": "off",
31
- "no-console": "off",
32
- "no-restricted-globals": "off",
33
- "no-debugger": "off",
34
- "no-use-before-define": "off",
35
- "no-promise-executor-return": "off",
36
- "spaced-comment": "off"
37
- }
1
+ module.exports = {
2
+ env: {
3
+ browser: true,
4
+ es2021: true
5
+ },
6
+ globals: {
7
+ defineOptions: true
8
+ },
9
+ extends: ["eslint-config-prettier", "plugin:import/recommended", "eslint:recommended", "plugin:vue/vue3-recommended", "plugin:prettier/recommended"],
10
+ overrides: [],
11
+ parserOptions: {
12
+ ecmaVersion: "latest",
13
+ sourceType: "module",
14
+ ecmaFeatures: {
15
+ jsx: true
16
+ }
17
+ },
18
+ plugins: ["vue"],
19
+ rules: {
20
+ "import/prefer-default-export": "off",
21
+ "import/no-extraneous-dependencies": "off",
22
+ "import/no-duplicates": "off",
23
+ "import/named": "off",
24
+ "import/order": "off",
25
+ "import/first": "off",
26
+ "vue/attributes-order": "off",
27
+ "vue/no-mutating-props": "off",
28
+ "vue/no-reserved-component-names": "off",
29
+ "vue/no-v-html": "off",
30
+ "no-param-reassign": "off",
31
+ "no-console": "off",
32
+ "no-restricted-globals": "off",
33
+ "no-debugger": "off",
34
+ "no-use-before-define": "off",
35
+ "no-promise-executor-return": "off",
36
+ "spaced-comment": "off"
37
+ }
38
38
  };
package/.prettierrc.cjs CHANGED
@@ -1,38 +1,38 @@
1
- module.exports = {
2
- // 一行最多多少个字符
3
- printWidth: 150,
4
- // 指定每个缩进级别的空格数
5
- tabWidth: 4,
6
- // 使用制表符而不是空格缩进行
7
- useTabs: true,
8
- // 在语句末尾是否需要分号
9
- semi: false,
10
- // 是否使用单引号
11
- singleQuote: false,
12
- // 更改引用对象属性的时间 可选值"<as-needed|consistent|preserve>"
13
- quoteProps: "as-needed",
14
- // 多行时尽可能打印尾随逗号。(例如,单行数组永远不会出现逗号结尾。) 可选值"<none|es5|all>",默认none
15
- trailingComma: "all",
16
- // 在对象文字中的括号之间打印空格
17
- bracketSpacing: true,
18
- // 在单独的箭头函数参数周围包括括号 always:(x) => x \ avoid:x => x
19
- arrowParens: "always",
20
- // 这两个选项可用于格式化以给定字符偏移量(分别包括和不包括)开始和结束的代码
21
- rangeStart: 0,
22
- rangeEnd: Infinity,
23
- // 指定要使用的解析器,不需要写文件开头的 @prettier
24
- requirePragma: false,
25
- // 不需要自动在文件开头插入 @prettier
26
- insertPragma: false,
27
- // 使用默认的折行标准 always\never\preserve
28
- proseWrap: "preserve",
29
- // 指定HTML文件的全局空格敏感度 css\strict\ignore
30
- htmlWhitespaceSensitivity: "css",
31
- // Vue文件脚本和样式标签缩进
32
- vueIndentScriptAndStyle: false,
33
- // 在 windows 操作系统中换行符通常是回车 (CR) 加换行分隔符 (LF),也就是回车换行(CRLF),
34
- // 然而在 Linux 和 Unix 中只使用简单的换行分隔符 (LF)。
35
- // 对应的控制字符为 "\n" (LF) 和 "\r\n"(CRLF)。auto意为保持现有的行尾
36
- // 换行符使用 lf 结尾是 可选值"<auto|lf|crlf|cr>"
37
- endOfLine: "auto"
38
- }
1
+ module.exports = {
2
+ // 一行最多多少个字符
3
+ printWidth: 150,
4
+ // 指定每个缩进级别的空格数
5
+ tabWidth: 4,
6
+ // 使用制表符而不是空格缩进行
7
+ useTabs: true,
8
+ // 在语句末尾是否需要分号
9
+ semi: false,
10
+ // 是否使用单引号
11
+ singleQuote: false,
12
+ // 更改引用对象属性的时间 可选值"<as-needed|consistent|preserve>"
13
+ quoteProps: "as-needed",
14
+ // 多行时尽可能打印尾随逗号。(例如,单行数组永远不会出现逗号结尾。) 可选值"<none|es5|all>",默认none
15
+ trailingComma: "all",
16
+ // 在对象文字中的括号之间打印空格
17
+ bracketSpacing: true,
18
+ // 在单独的箭头函数参数周围包括括号 always:(x) => x \ avoid:x => x
19
+ arrowParens: "always",
20
+ // 这两个选项可用于格式化以给定字符偏移量(分别包括和不包括)开始和结束的代码
21
+ rangeStart: 0,
22
+ rangeEnd: Infinity,
23
+ // 指定要使用的解析器,不需要写文件开头的 @prettier
24
+ requirePragma: false,
25
+ // 不需要自动在文件开头插入 @prettier
26
+ insertPragma: false,
27
+ // 使用默认的折行标准 always\never\preserve
28
+ proseWrap: "preserve",
29
+ // 指定HTML文件的全局空格敏感度 css\strict\ignore
30
+ htmlWhitespaceSensitivity: "css",
31
+ // Vue文件脚本和样式标签缩进
32
+ vueIndentScriptAndStyle: false,
33
+ // 在 windows 操作系统中换行符通常是回车 (CR) 加换行分隔符 (LF),也就是回车换行(CRLF),
34
+ // 然而在 Linux 和 Unix 中只使用简单的换行分隔符 (LF)。
35
+ // 对应的控制字符为 "\n" (LF) 和 "\r\n"(CRLF)。auto意为保持现有的行尾
36
+ // 换行符使用 lf 结尾是 可选值"<auto|lf|crlf|cr>"
37
+ endOfLine: "auto"
38
+ }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # jobsys-explore
2
2
 
3
+ ## 4.0.18
4
+
5
+ ### Patch Changes
6
+
7
+ - Add useFindOptionByValue
8
+ - Upgrade
9
+
10
+ ## 4.0.17
11
+
12
+ ### Patch Changes
13
+
14
+ - address
15
+ - y
16
+ - add exPros parameter
17
+ - option fetch data only once
18
+ - add form reset
19
+ - fixed
20
+ - add sm2 encrypt
21
+ - form expose fetchItem method
22
+ - fixed address modelValue
23
+ - fixed textInValue
24
+ - fixed textInValue
25
+ - add key_cn
26
+ - search watch model value
27
+ - address
28
+ - cascader
29
+ - e
30
+
3
31
  ## 4.0.16
4
32
 
5
33
  ### Patch Changes
package/README.md CHANGED
@@ -1,41 +1,41 @@
1
- # TODOs
2
-
3
- ---
4
-
5
- ## 增强
6
-
7
- - [ ] ExploreForm
8
-
9
- - [x] Address
10
- - [x] Cascader
11
- - [x] Checkbox
12
- - [x] Date
13
- - [ ] Group
14
- - [ ] Html
15
- - [x] Input
16
- - [x] Number
17
- - [x] Radio
18
- - [ ] Remote
19
- - [x] Select
20
- - [x] Switch
21
- - [] Tag
22
- - [x] Text
23
- - [x] Time
24
- - [ ] TreeSelect
25
- - [x] Uploader
26
-
27
- - [x] ExploreSearch
28
-
29
- - [x] 同上
30
-
31
- - [x] Field
32
- - [x] Disabled
33
- - [x] Help
34
-
35
- ## 新增
36
-
37
- - [ ] 样式定制
38
- - [ ] 浮动按钮
39
- - [ ] 列表组件
40
- - [ ] 背景生成
41
- - [ ] 简易图表
1
+ # TODOs
2
+
3
+ ---
4
+
5
+ ## 增强
6
+
7
+ - [ ] ExploreForm
8
+
9
+ - [x] Address
10
+ - [x] Cascader
11
+ - [x] Checkbox
12
+ - [x] Date
13
+ - [ ] Group
14
+ - [ ] Html
15
+ - [x] Input
16
+ - [x] Number
17
+ - [x] Radio
18
+ - [ ] Remote
19
+ - [x] Select
20
+ - [x] Switch
21
+ - [] Tag
22
+ - [x] Text
23
+ - [x] Time
24
+ - [ ] TreeSelect
25
+ - [x] Uploader
26
+
27
+ - [x] ExploreSearch
28
+
29
+ - [x] 同上
30
+
31
+ - [x] Field
32
+ - [x] Disabled
33
+ - [x] Help
34
+
35
+ ## 新增
36
+
37
+ - [ ] 样式定制
38
+ - [ ] 浮动按钮
39
+ - [ ] 列表组件
40
+ - [ ] 背景生成
41
+ - [ ] 简易图表
package/TODOs.md CHANGED
@@ -1,8 +1,8 @@
1
- # Bugs
2
-
3
- - [ ] ExPagination 无限加载数据问题
4
-
5
- # Improvements
6
-
7
- # Features
8
-
1
+ # Bugs
2
+
3
+ - [ ] ExPagination 无限加载数据问题
4
+
5
+ # Improvements
6
+
7
+ # Features
8
+
@@ -1,120 +1,120 @@
1
- import { defineComponent } from "vue"
2
- import { Button } from "vant"
3
- import "./index.less"
4
-
5
- /**
6
- * 主题组件
7
- * @version 1.0.0
8
- */
9
- export default defineComponent({
10
- name: "ExButton",
11
- props: {
12
- /**
13
- * 按钮类型
14
- * @values primary, success, warning, danger
15
- */
16
- type: { type: String, default: "default" },
17
-
18
- /**
19
- * 按钮大小
20
- * @values large, normal, small, mini
21
- */
22
- size: { type: String, default: "normal" },
23
-
24
- /**
25
- * 失效状态
26
- */
27
- disabled: { type: Boolean, default: false },
28
-
29
- /**
30
- * 是否圆形按钮
31
- */
32
- round: { type: Boolean, default: true },
33
-
34
- /**
35
- * 是否块状按钮
36
- */
37
- block: { type: Boolean, default: true },
38
-
39
- /**
40
- * 按钮标签
41
- */
42
- text: { type: String, default: "" },
43
-
44
- /**
45
- * 按钮图标,需要使用
46
- *
47
- */
48
- icon: { type: Object, default: null },
49
-
50
- /**
51
- * 按钮图标位置
52
- * @values left, right
53
- */
54
- iconPosition: { type: String, default: "left" },
55
-
56
- /**
57
- * 请求状态控制器
58
- * @param {boolean} fetcher.loading 是否加载中
59
- */
60
- fetcher: {
61
- type: Object,
62
- default: () => ({ loading: false }),
63
- },
64
-
65
- /**
66
- * [原生配置](https://vant-contrib.gitee.io/vant/#/zh-CN/button)
67
- */
68
- buttonProps: {
69
- type: Object,
70
- default: () => ({}),
71
- },
72
- },
73
- emits: [
74
- /**
75
- * @event click
76
- * @param {Event} event 点击事件
77
- */
78
- "click",
79
- ],
80
-
81
- setup(props, { emit, slots }) {
82
- const onClick = (e) => {
83
- /**
84
- * @event click 点击事件
85
- */
86
- emit("click", e)
87
- }
88
-
89
- const defaultLabel = () => {
90
- return props.text || slots.default?.()
91
- }
92
-
93
- const defaultSlot = () => {
94
- if (props.icon && props.iconPosition === "left") {
95
- return [props.icon, defaultLabel()]
96
- } else if (props.icon && props.iconPosition === "right") {
97
- return [defaultLabel(), props.icon]
98
- }
99
- return [defaultLabel()]
100
- }
101
-
102
- return () => (
103
- <Button
104
- class={"ex-button"}
105
- loading={props.fetcher.loading}
106
- type={props.type}
107
- size={props.size}
108
- disabled={props.disabled}
109
- round={props.round}
110
- block={props.block}
111
- onClick={onClick}
112
- {...props.buttonProps}
113
- >
114
- {{
115
- default: () => defaultSlot(),
116
- }}
117
- </Button>
118
- )
119
- },
120
- })
1
+ import { defineComponent } from "vue"
2
+ import { Button } from "vant"
3
+ import "./index.less"
4
+
5
+ /**
6
+ * 主题组件
7
+ * @version 1.0.0
8
+ */
9
+ export default defineComponent({
10
+ name: "ExButton",
11
+ props: {
12
+ /**
13
+ * 按钮类型
14
+ * @values primary, success, warning, danger
15
+ */
16
+ type: { type: String, default: "default" },
17
+
18
+ /**
19
+ * 按钮大小
20
+ * @values large, normal, small, mini
21
+ */
22
+ size: { type: String, default: "normal" },
23
+
24
+ /**
25
+ * 失效状态
26
+ */
27
+ disabled: { type: Boolean, default: false },
28
+
29
+ /**
30
+ * 是否圆形按钮
31
+ */
32
+ round: { type: Boolean, default: true },
33
+
34
+ /**
35
+ * 是否块状按钮
36
+ */
37
+ block: { type: Boolean, default: true },
38
+
39
+ /**
40
+ * 按钮标签
41
+ */
42
+ text: { type: String, default: "" },
43
+
44
+ /**
45
+ * 按钮图标,需要使用
46
+ *
47
+ */
48
+ icon: { type: Object, default: null },
49
+
50
+ /**
51
+ * 按钮图标位置
52
+ * @values left, right
53
+ */
54
+ iconPosition: { type: String, default: "left" },
55
+
56
+ /**
57
+ * 请求状态控制器
58
+ * @param {boolean} fetcher.loading 是否加载中
59
+ */
60
+ fetcher: {
61
+ type: Object,
62
+ default: () => ({ loading: false }),
63
+ },
64
+
65
+ /**
66
+ * [原生配置](https://vant-contrib.gitee.io/vant/#/zh-CN/button)
67
+ */
68
+ buttonProps: {
69
+ type: Object,
70
+ default: () => ({}),
71
+ },
72
+ },
73
+ emits: [
74
+ /**
75
+ * @event click
76
+ * @param {Event} event 点击事件
77
+ */
78
+ "click",
79
+ ],
80
+
81
+ setup(props, { emit, slots }) {
82
+ const onClick = (e) => {
83
+ /**
84
+ * @event click 点击事件
85
+ */
86
+ emit("click", e)
87
+ }
88
+
89
+ const defaultLabel = () => {
90
+ return props.text || slots.default?.()
91
+ }
92
+
93
+ const defaultSlot = () => {
94
+ if (props.icon && props.iconPosition === "left") {
95
+ return [props.icon, defaultLabel()]
96
+ } else if (props.icon && props.iconPosition === "right") {
97
+ return [defaultLabel(), props.icon]
98
+ }
99
+ return [defaultLabel()]
100
+ }
101
+
102
+ return () => (
103
+ <Button
104
+ class={"ex-button"}
105
+ loading={props.fetcher.loading}
106
+ type={props.type}
107
+ size={props.size}
108
+ disabled={props.disabled}
109
+ round={props.round}
110
+ block={props.block}
111
+ onClick={onClick}
112
+ {...props.buttonProps}
113
+ >
114
+ {{
115
+ default: () => defaultSlot(),
116
+ }}
117
+ </Button>
118
+ )
119
+ },
120
+ })
@@ -1,4 +1,4 @@
1
- import _ExButton from "./ExButton.jsx"
2
- import withInstall from "../../utils/withInstall"
3
- export const ExButton = withInstall(_ExButton)
4
- export default ExButton
1
+ import _ExButton from "./ExButton.jsx"
2
+ import withInstall from "../../utils/withInstall"
3
+ export const ExButton = withInstall(_ExButton)
4
+ export default ExButton
@@ -1,8 +1,8 @@
1
- .ex-button {
2
- padding: 0 40px;
3
- }
4
-
5
- :root:root {
6
- --van-button-normal-font-size: 16px;
7
- --van-button-default-height: 48px;
1
+ .ex-button {
2
+ padding: 0 40px;
3
+ }
4
+
5
+ :root:root {
6
+ --van-button-normal-font-size: 16px;
7
+ --van-button-default-height: 48px;
8
8
  }