@ecolovo/uniapp-components 1.0.6 → 1.0.8

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 (66) hide show
  1. package/README.md +124 -0
  2. package/components/aspect/aspect.vue +3 -3
  3. package/components/badge/badge.vue +1 -1
  4. package/components/button/button.vue +2 -2
  5. package/components/checkbox/checkbox.vue +1 -1
  6. package/components/checkbox-group/checkbox-group.vue +1 -1
  7. package/components/checkbox-group2/checkbox-group2.vue +1 -1
  8. package/components/checkbox-group2/checkbox.vue +1 -1
  9. package/components/data-list/data-list.vue +1 -1
  10. package/components/date-picker/date-picker-view.vue +1 -1
  11. package/components/date-picker/date-picker.vue +1 -1
  12. package/components/datetime-picker/datetime-picker-view.vue +1 -1
  13. package/components/datetime-picker/datetime-picker.vue +1 -1
  14. package/components/dialog/dialog-content.vue +1 -1
  15. package/components/dialog/dialog.vue +1 -1
  16. package/components/dropdown/dropdown.vue +1 -1
  17. package/components/empty/empty.vue +1 -1
  18. package/components/flex/flex.vue +1 -1
  19. package/components/form/form.vue +1 -1
  20. package/components/form-item/form-item.vue +1 -1
  21. package/components/icon/icon.vue +1 -1
  22. package/components/image/image.vue +1 -1
  23. package/components/input/input.vue +1 -1
  24. package/components/input/password-input.vue +1 -1
  25. package/components/list-page/list-page.vue +1 -1
  26. package/components/load-more/load-more.vue +1 -1
  27. package/components/loading/animations/loading-animation1.vue +1 -1
  28. package/components/loading/animations/loading-animation2.vue +1 -1
  29. package/components/loading/animations/loading-animation3.vue +1 -1
  30. package/components/loading/animations/loading-animation4.vue +1 -1
  31. package/components/loading/loading.vue +1 -1
  32. package/components/message-box/message-box.vue +1 -1
  33. package/components/number-dialog/number-dialog.vue +1 -1
  34. package/components/number-input/number-input.vue +1 -1
  35. package/components/numpad/numpad.vue +1 -1
  36. package/components/page/page-body.vue +1 -1
  37. package/components/page/page-footer.vue +1 -1
  38. package/components/page/page-header.vue +1 -1
  39. package/components/page/page.vue +1 -1
  40. package/components/picker/picker-popup.vue +1 -1
  41. package/components/picker/picker.vue +1 -1
  42. package/components/popover/popover-content.vue +1 -1
  43. package/components/popover/popover-mask.vue +1 -1
  44. package/components/popover/popover.vue +1 -1
  45. package/components/popup/popup-content.vue +1 -1
  46. package/components/popup/popup.vue +1 -1
  47. package/components/price/price.vue +1 -1
  48. package/components/search/search.vue +1 -1
  49. package/components/searching/searching.vue +1 -1
  50. package/components/selector/selector.vue +1 -1
  51. package/components/switch/switch.vue +1 -1
  52. package/components/tab/tab.vue +1 -1
  53. package/components/table/table.vue +1 -1
  54. package/components/textarea/textarea.vue +1 -1
  55. package/components/time-picker/time-picker-view.vue +1 -1
  56. package/components/time-picker/time-picker.vue +1 -1
  57. package/components/uploader/file-uploader.vue +1 -1
  58. package/components/uploader/media-uploader.vue +1 -1
  59. package/components/uploader/upload-button.vue +1 -1
  60. package/components/uploader/uploader.vue +1 -1
  61. package/configs/index.js +1 -0
  62. package/mixins/componentName.js +2 -2
  63. package/package.json +14 -1
  64. package/styles/global.scss +4 -4
  65. package/styles/utils/z-index.scss +1 -1
  66. package/styles/var/theme.scss +20 -10
package/README.md ADDED
@@ -0,0 +1,124 @@
1
+ # @ecolovo/uniapp-components
2
+
3
+ Ecolovo UniApp 组件库
4
+
5
+
6
+ ## Installation
7
+
8
+ 使用 npm / yarn 安装
9
+
10
+ ```bash
11
+ npm install @ecolovo/uniapp-components
12
+ ```
13
+
14
+ 同时需要使用 `uni-pages-hot-modules` 用来动态配置
15
+
16
+ ```bash
17
+ npm install uni-pages-hot-modules --save-dev
18
+ ```
19
+
20
+ ## Usage
21
+
22
+ ### 1. 配置 `vue.config.js` 文件
23
+
24
+ ```javascript
25
+ // vue.config.js
26
+
27
+ module.exports = {
28
+ // configs...
29
+ transpileDependencies: ['@ecolovo/uniapp-components'],
30
+ // other configs...
31
+ }
32
+ ```
33
+
34
+ ### 2. 在 `src/main.js` 文件中初始化组件库
35
+
36
+ ```javascript
37
+ // src/main.js
38
+
39
+ import init from '@ecolovo/uniapp-components/init';
40
+
41
+ init({
42
+ // 配置组件前缀
43
+ // 在使用时加上前缀,如 button 组件,使用 <ui-button>
44
+ componentPrefix: 'ui',
45
+ });
46
+ ```
47
+
48
+ ### 3. 配置 `src/pages.js` 文件,
49
+
50
+ ```javascript
51
+ // src/pages.js
52
+
53
+ const mergeWith = require('lodash/mergeWith');
54
+ const { hot } = require('uni-pages-hot-modules');
55
+ const componentEasyCom = require('@ecolovo/uniapp-components/easyCom');
56
+
57
+ module.exports = hot((pagesJson) => {
58
+ const pagesConfig = require('./pagesDef');
59
+
60
+ return mergeWith(
61
+ // pages.json 中的配置
62
+ pagesJson,
63
+ pagesConfig,
64
+ componentEasyCom('ui'), // 填入和步骤 2 中同样的前缀
65
+ function (objValue, srcValue) {
66
+ if (Array.isArray(objValue)) {
67
+ return objValue.concat(srcValue);
68
+ }
69
+ }
70
+ );
71
+ });
72
+ ```
73
+
74
+ ### 4. 配置样式
75
+
76
+ #### 全局样式
77
+
78
+ ```html
79
+ <!-- App.vue -->
80
+
81
+ <style lang="scss">
82
+ @use '@ecolovo/uniapp-components/styles/global';
83
+ </style>
84
+ ```
85
+
86
+ #### 自定义组件配置
87
+
88
+ ```css
89
+ /* src/styles/prepend.scss */
90
+
91
+ @forward '@ecolovo/uniapp-components/styles/var/theme' with (
92
+ $themes: (
93
+ primary: #d92e20,
94
+ )
95
+ );
96
+
97
+ @forward '@ecolovo/uniapp-components/styles';
98
+ ```
99
+
100
+ ```javascript
101
+ // vue.config.js
102
+
103
+ const sass = require('sass');
104
+
105
+ module.exports = {
106
+ // configs...
107
+ css: {
108
+ loaderOptions: {
109
+ scss: {
110
+ prependData: '@use "@/styles/prepend" as *;'
111
+ },
112
+ },
113
+ },
114
+ // other configs...
115
+ };
116
+ ```
117
+
118
+ ## Components
119
+
120
+ ### Aspect
121
+
122
+ #### 属性
123
+
124
+ - ratio: `string | number` 纵横比,默认为 `1` ,即宽高相等
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <view :class="componentClassNames">
3
- <view :class="$style['Aspect--content-wrapper']" :style="{ paddingTop: 100 / ratio + '%' }">
3
+ <view :class="$style['Aspect--content-wrapper']" :style="{ paddingTop: 100 * ratio + '%' }">
4
4
  <view :class="$style['Aspect--content']" @click="$emit('click')">
5
5
  <slot></slot>
6
6
  </view>
@@ -12,14 +12,14 @@
12
12
  import componentName from '../../mixins/componentName';
13
13
 
14
14
  export default {
15
- name: 'AppAspect',
15
+ name: 'Aspect',
16
16
  options: {
17
17
  virtualHost: true,
18
18
  styleIsolation: 'shared',
19
19
  },
20
20
  mixins: [componentName],
21
21
  props: {
22
- /** 纵横比,默认为 1,即宽高相等 */
22
+ /** 高与宽的比例,默认为 1,即宽高相等,2 表示高为宽的 2 倍 */
23
23
  ratio: {
24
24
  type: [String, Number],
25
25
  default: 1,
@@ -19,7 +19,7 @@
19
19
  import componentName from '../../mixins/componentName';
20
20
 
21
21
  export default {
22
- name: 'AppBadge',
22
+ name: 'Badge',
23
23
  options: {
24
24
  virtualHost: true,
25
25
  styleIsolation: 'shared',
@@ -64,7 +64,7 @@ import IconCpn from '../icon/icon.vue';
64
64
  * 当 async 为 true 时,需要在父组件监听 click 事件的回调函数中调用传入的 resolve 或 reject 方法,否则按钮将持续处于 loading 状态
65
65
  */
66
66
  export default {
67
- name: 'AppButton',
67
+ name: 'Button',
68
68
  components: { IconCpn },
69
69
  mixins: [componentName],
70
70
  options: {
@@ -240,7 +240,7 @@ $component-vars: $button;
240
240
  }
241
241
 
242
242
  %button-themes {
243
- @each $name, $color in $component-themes {
243
+ @each $name, $color in $themes {
244
244
  --button-theme-#{$name}: #{$color};
245
245
  }
246
246
  }
@@ -18,7 +18,7 @@ import { isFormReadonly } from '../form/mixin';
18
18
  import IconCpn from '../icon/icon.vue';
19
19
 
20
20
  export default {
21
- name: 'AppCheckbox',
21
+ name: 'Checkbox',
22
22
  options: {
23
23
  virtualHost: true,
24
24
  styleIsolation: 'shared',
@@ -8,7 +8,7 @@
8
8
  import componentName from '../../mixins/componentName';
9
9
 
10
10
  export default {
11
- name: 'AppCheckboxGroup',
11
+ name: 'CheckboxGroup',
12
12
  options: {
13
13
  virtualHost: true,
14
14
  styleIsolation: 'shared',
@@ -20,7 +20,7 @@ import componentName from '../../mixins/componentName';
20
20
  import CheckboxCpn from './checkbox.vue';
21
21
 
22
22
  export default {
23
- name: 'AppCheckboxGroup2',
23
+ name: 'CheckboxGroup2',
24
24
  options: {
25
25
  virtualHost: true,
26
26
  styleIsolation: 'shared',
@@ -17,7 +17,7 @@ import componentName from '../../mixins/componentName';
17
17
  import IconCpn from '../icon/icon.vue';
18
18
 
19
19
  export default {
20
- name: 'AppCheckbox2',
20
+ name: 'Checkbox2',
21
21
  options: {
22
22
  virtualHost: true,
23
23
  styleIsolation: 'shared',
@@ -19,7 +19,7 @@ import componentName from '../../mixins/componentName';
19
19
  import LoadMoreCpn from '../load-more/load-more.vue';
20
20
 
21
21
  export default {
22
- name: 'AppDataList',
22
+ name: 'DataList',
23
23
  options: {
24
24
  virtualHost: true,
25
25
  styleIsolation: 'shared',
@@ -47,7 +47,7 @@ function getDateOptions(date) {
47
47
  }
48
48
 
49
49
  export default {
50
- name: 'AppDatePickerView',
50
+ name: 'DatePickerView',
51
51
  options: {
52
52
  virtualHost: true,
53
53
  styleIsolation: 'shared',
@@ -61,7 +61,7 @@ import SelectorCpn from '../selector/selector.vue';
61
61
  import DatePickerViewCpn from './date-picker-view.vue';
62
62
 
63
63
  export default {
64
- name: 'AppDatePicker',
64
+ name: 'DatePicker',
65
65
  options: {
66
66
  virtualHost: true,
67
67
  styleIsolation: 'shared',
@@ -57,7 +57,7 @@ function getDateOptions(date) {
57
57
  }
58
58
 
59
59
  export default {
60
- name: 'AppDatetimePickerView',
60
+ name: 'DatetimePickerView',
61
61
  options: {
62
62
  virtualHost: true,
63
63
  styleIsolation: 'shared',
@@ -51,7 +51,7 @@ import DatetimePickerViewCpn from './datetime-picker-view.vue';
51
51
  const DATE_FORMAT = formatDate.DATE_MINUTE_WITH_YEAR;
52
52
 
53
53
  export default {
54
- name: 'AppDatetimePicker',
54
+ name: 'DatetimePicker',
55
55
  options: {
56
56
  virtualHost: true,
57
57
  styleIsolation: 'shared',
@@ -51,7 +51,7 @@ import IconCpn from '../icon/icon.vue';
51
51
  import PopoverContentCpn from '../popover/popover-content.vue';
52
52
 
53
53
  export default {
54
- name: 'AppDialogContent',
54
+ name: 'DialogContent',
55
55
  options: {
56
56
  virtualHost: true,
57
57
  styleIsolation: 'shared',
@@ -31,7 +31,7 @@ import PopoverMaskCpn from '../popover/popover-mask.vue';
31
31
  import DialogContentCpn from './dialog-content.vue';
32
32
 
33
33
  export default {
34
- name: 'AppDialog',
34
+ name: 'Dialog',
35
35
  options: {
36
36
  virtualHost: true,
37
37
  styleIsolation: 'shared',
@@ -19,7 +19,7 @@ import componentName from '../../mixins/componentName';
19
19
  import IconCpn from '../../icon/icon.vue';
20
20
 
21
21
  export default {
22
- name: 'AppDropdown',
22
+ name: 'Dropdown',
23
23
  options: {
24
24
  virtualHost: true,
25
25
  styleIsolation: 'shared',
@@ -24,7 +24,7 @@ import componentName from '../../mixins/componentName';
24
24
  import IconCpn from '../icon/icon.vue';
25
25
 
26
26
  export default {
27
- name: 'AppEmpty',
27
+ name: 'Empty',
28
28
  options: {
29
29
  virtualHost: true,
30
30
  styleIsolation: 'shared',
@@ -8,7 +8,7 @@
8
8
  import componentName from '../../mixins/componentName';
9
9
 
10
10
  export default {
11
- name: 'AppFlex',
11
+ name: 'Flex',
12
12
  options: {
13
13
  virtualHost: true,
14
14
  styleIsolation: 'shared',
@@ -8,7 +8,7 @@
8
8
  import componentName from '../../mixins/componentName';
9
9
 
10
10
  export default {
11
- name: 'AppForm',
11
+ name: 'Form',
12
12
  options: {
13
13
  virtualHost: true,
14
14
  styleIsolation: 'shared',
@@ -24,7 +24,7 @@ import componentName from '../../mixins/componentName';
24
24
  import { isFormReadonly } from '../form/mixin';
25
25
 
26
26
  export default {
27
- name: 'AppFormItem',
27
+ name: 'FormItem',
28
28
  options: {
29
29
  virtualHost: true,
30
30
  styleIsolation: 'shared',
@@ -14,7 +14,7 @@ import { iconMap } from '../../configs';
14
14
  const iconListStr = iconMap.keys().toArray().sort().join('\n');
15
15
 
16
16
  export default {
17
- name: 'AppIcon',
17
+ name: 'Icon',
18
18
  options: {
19
19
  virtualHost: true,
20
20
  styleIsolation: 'shared',
@@ -12,7 +12,7 @@
12
12
  import componentName from '../../mixins/componentName';
13
13
 
14
14
  export default {
15
- name: 'AppImage',
15
+ name: 'Image',
16
16
  options: {
17
17
  virtualHost: true,
18
18
  styleIsolation: 'shared',
@@ -38,7 +38,7 @@ import { isFormReadonly } from '../form/mixin';
38
38
  import IconCpn from '../icon/icon.vue';
39
39
 
40
40
  export default {
41
- name: 'AppInput',
41
+ name: 'Input',
42
42
  options: {
43
43
  virtualHost: true,
44
44
  styleIsolation: 'shared',
@@ -25,7 +25,7 @@ import componentName from '../../mixins/componentName';
25
25
  import IconCpn from '../icon/icon.vue';
26
26
 
27
27
  export default {
28
- name: 'AppPasswordInput',
28
+ name: 'PasswordInput',
29
29
  options: {
30
30
  virtualHost: true,
31
31
  styleIsolation: 'shared',
@@ -36,7 +36,7 @@ import EmptyCpn from '../empty/empty.vue';
36
36
  import PageCpn from '../page/page.vue';
37
37
 
38
38
  export default {
39
- name: 'AppListPage',
39
+ name: 'ListPage',
40
40
  options: {
41
41
  virtualHost: true,
42
42
  styleIsolation: 'shared',
@@ -16,7 +16,7 @@ import componentName from '../../mixins/componentName';
16
16
  import IconCpn from '../icon/icon.vue';
17
17
 
18
18
  export default {
19
- name: 'AppLoadMore',
19
+ name: 'LoadMore',
20
20
  options: {
21
21
  virtualHost: true,
22
22
  styleIsolation: 'shared',
@@ -9,7 +9,7 @@
9
9
  import componentName from '../../../mixins/componentName';
10
10
 
11
11
  export default {
12
- name: 'AppLoadingAnimation1',
12
+ name: 'LoadingAnimation1',
13
13
  options: {
14
14
  virtualHost: true,
15
15
  styleIsolation: 'shared',
@@ -9,7 +9,7 @@ import componentName from '../../../mixins/componentName';
9
9
  import IconCpn from '../../icon/icon.vue';
10
10
 
11
11
  export default {
12
- name: 'AppLoadingAnimation2',
12
+ name: 'LoadingAnimation2',
13
13
  options: {
14
14
  virtualHost: true,
15
15
  styleIsolation: 'shared',
@@ -8,7 +8,7 @@
8
8
  import componentName from '../../../mixins/componentName';
9
9
 
10
10
  export default {
11
- name: 'AppLoadingAnimation3',
11
+ name: 'LoadingAnimation3',
12
12
  options: {
13
13
  virtualHost: true,
14
14
  styleIsolation: 'shared',
@@ -8,7 +8,7 @@
8
8
  import componentName from '../../../mixins/componentName';
9
9
 
10
10
  export default {
11
- name: 'AppLoadingAnimation4',
11
+ name: 'LoadingAnimation4',
12
12
  options: {
13
13
  virtualHost: true,
14
14
  styleIsolation: 'shared',
@@ -17,7 +17,7 @@ import componentName from '../../mixins/componentName';
17
17
  import LoadingAnimation3 from './animations/loading-animation3.vue';
18
18
 
19
19
  export default {
20
- name: 'AppLoading',
20
+ name: 'Loading',
21
21
  options: {
22
22
  virtualHost: true,
23
23
  styleIsolation: 'shared',
@@ -19,7 +19,7 @@ import componentName from '../../mixins/componentName';
19
19
  import DialogCpn from '../dialog/dialog.vue';
20
20
 
21
21
  export default {
22
- name: 'AppMessageBox',
22
+ name: 'MessageBox',
23
23
  options: {
24
24
  virtualHost: true,
25
25
  styleIsolation: 'shared',
@@ -78,7 +78,7 @@ const MIN = 0;
78
78
  const MAX = 9999;
79
79
 
80
80
  export default {
81
- name: 'AppNumberDialog',
81
+ name: 'NumberDialog',
82
82
  options: {
83
83
  virtualHost: true,
84
84
  styleIsolation: 'shared',
@@ -64,7 +64,7 @@ const MAX = 9999999999;
64
64
  const numberReg = /^(-?)(\d*)()(-?)$/;
65
65
 
66
66
  export default {
67
- name: 'AppNumberInput',
67
+ name: 'NumberInput',
68
68
  options: {
69
69
  virtualHost: true,
70
70
  styleIsolation: 'shared',
@@ -42,7 +42,7 @@ const buttons = freezeDeep([
42
42
  ]);
43
43
 
44
44
  export default {
45
- name: 'AppNumpad',
45
+ name: 'Numpad',
46
46
  options: {
47
47
  virtualHost: true,
48
48
  styleIsolation: 'shared',
@@ -54,7 +54,7 @@ import windowInfoMixin from '../../mixins/windowInfo';
54
54
  const SCROLL_ANIMATION_DURATION = 300;
55
55
 
56
56
  export default {
57
- name: 'AppPageBody',
57
+ name: 'PageBody',
58
58
  options: {
59
59
  virtualHost: true,
60
60
  styleIsolation: 'shared',
@@ -15,7 +15,7 @@ import componentName from '../../mixins/componentName';
15
15
  import windowInfoMixin from '../../mixins/windowInfo';
16
16
 
17
17
  export default {
18
- name: 'AppPageFooter',
18
+ name: 'PageFooter',
19
19
  options: {
20
20
  virtualHost: true,
21
21
  styleIsolation: 'shared',
@@ -59,7 +59,7 @@ import windowInfoMixin from '../../mixins/windowInfo';
59
59
  import IconCpn from '../icon/icon.vue';
60
60
 
61
61
  export default {
62
- name: 'AppPageHeader',
62
+ name: 'PageHeader',
63
63
  options: {
64
64
  virtualHost: true,
65
65
  styleIsolation: 'shared',
@@ -37,7 +37,7 @@ import PageFooterCpn from './page-footer.vue';
37
37
  import PageHeaderCpn from './page-header.vue';
38
38
 
39
39
  export default {
40
- name: 'AppPage',
40
+ name: 'Page',
41
41
  options: {
42
42
  virtualHost: true,
43
43
  styleIsolation: 'shared',
@@ -74,7 +74,7 @@ import PopupContentCpn from '../popup/popup-content.vue';
74
74
  import SearchCpn from '../search/search.vue';
75
75
 
76
76
  export default {
77
- name: 'AppPickerPopup',
77
+ name: 'PickerPopup',
78
78
  options: {
79
79
  virtualHost: true,
80
80
  styleIsolation: 'shared',
@@ -32,7 +32,7 @@ import SelectorCpn from '../selector/selector.vue';
32
32
  import PickerPopupCpn from './picker-popup.vue';
33
33
 
34
34
  export default {
35
- name: 'AppPicker',
35
+ name: 'Picker',
36
36
  options: {
37
37
  virtualHost: true,
38
38
  styleIsolation: 'shared',
@@ -41,7 +41,7 @@ import windowInfoMixin from '../../mixins/windowInfo';
41
41
  import IconCpn from '../icon/icon.vue';
42
42
 
43
43
  export default {
44
- name: 'AppPopoverContent',
44
+ name: 'PopoverContent',
45
45
  options: {
46
46
  virtualHost: true,
47
47
  styleIsolation: 'shared',
@@ -20,7 +20,7 @@
20
20
  import componentName from '../../mixins/componentName';
21
21
 
22
22
  export default {
23
- name: 'AppPopoverMask',
23
+ name: 'PopoverMask',
24
24
  options: {
25
25
  virtualHost: true,
26
26
  styleIsolation: 'shared',
@@ -36,7 +36,7 @@ import popoverContentCpn from './popover-content.vue';
36
36
  import popoverMaskCpn from './popover-mask.vue';
37
37
 
38
38
  export default {
39
- name: 'AppPopover',
39
+ name: 'Popover',
40
40
  options: {
41
41
  virtualHost: true,
42
42
  styleIsolation: 'shared',
@@ -51,7 +51,7 @@ import IconCpn from '../icon/icon.vue';
51
51
  import PopoverContentCpn from '../popover/popover-content.vue';
52
52
 
53
53
  export default {
54
- name: 'AppPopupContent',
54
+ name: 'PopupContent',
55
55
  options: {
56
56
  virtualHost: true,
57
57
  styleIsolation: 'shared',
@@ -33,7 +33,7 @@ import PopoverMaskCpn from '../popover/popover-mask.vue';
33
33
  import PopupContentCpn from './popup-content.vue';
34
34
 
35
35
  export default {
36
- name: 'AppPopup',
36
+ name: 'Popup',
37
37
  options: {
38
38
  virtualHost: true,
39
39
  styleIsolation: 'shared',
@@ -25,7 +25,7 @@ import componentName from '../../mixins/componentName';
25
25
  import { formatPrice } from '../../utils/price';
26
26
 
27
27
  export default {
28
- name: 'AppPrice',
28
+ name: 'Price',
29
29
  options: {
30
30
  virtualHost: true,
31
31
  styleIsolation: 'shared',
@@ -49,7 +49,7 @@ import ButtonCpn from '../button/button.vue';
49
49
  import IconCpn from '../icon/icon.vue';
50
50
 
51
51
  export default {
52
- name: 'AppSearch',
52
+ name: 'Search',
53
53
  options: {
54
54
  virtualHost: true,
55
55
  styleIsolation: 'shared',
@@ -15,7 +15,7 @@ import componentName from '../../mixins/componentName';
15
15
  import IconCpn from '../icon/icon.vue';
16
16
 
17
17
  export default {
18
- name: 'AppSearching',
18
+ name: 'Searching',
19
19
  options: {
20
20
  virtualHost: true,
21
21
  styleIsolation: 'shared',
@@ -19,7 +19,7 @@ import { isFormReadonly } from '../form/mixin';
19
19
  import IconCpn from '../icon/icon.vue';
20
20
 
21
21
  export default {
22
- name: 'AppSelector',
22
+ name: 'Selector',
23
23
  options: {
24
24
  virtualHost: true,
25
25
  styleIsolation: 'shared',
@@ -21,7 +21,7 @@ import { isFormReadonly } from '../form/mixin';
21
21
  import IconCpn from '../icon/icon.vue';
22
22
 
23
23
  export default {
24
- name: 'AppSwitch',
24
+ name: 'Switch',
25
25
  options: {
26
26
  virtualHost: true,
27
27
  styleIsolation: 'shared',
@@ -24,7 +24,7 @@
24
24
  import componentName from '../../mixins/componentName';
25
25
 
26
26
  export default {
27
- name: 'AppTab',
27
+ name: 'Tab',
28
28
  options: {
29
29
  virtualHost: true,
30
30
  styleIsolation: 'shared',
@@ -27,7 +27,7 @@ import componentName from '../../mixins/componentName';
27
27
  import { floor2 } from '../../utils/floor';
28
28
 
29
29
  export default {
30
- name: 'AppTable',
30
+ name: 'Table',
31
31
  options: {
32
32
  virtualHost: true,
33
33
  styleIsolation: 'shared',
@@ -40,7 +40,7 @@ import { isFormReadonly } from '../form/mixin';
40
40
  import IconCpn from '../icon/icon.vue';
41
41
 
42
42
  export default {
43
- name: 'AppTextarea',
43
+ name: 'Textarea',
44
44
  options: {
45
45
  virtualHost: true,
46
46
  styleIsolation: 'shared',
@@ -27,7 +27,7 @@ import { formatDate } from '../../utils/date';
27
27
  const hourOptions = range(0, 24).map((item) => ('' + item).padStart(2, '0'));
28
28
 
29
29
  export default {
30
- name: 'AppTimePickerView',
30
+ name: 'TimePickerView',
31
31
  options: {
32
32
  virtualHost: true,
33
33
  styleIsolation: 'shared',
@@ -37,7 +37,7 @@ import SelectorCpn from '../selector/selector.vue';
37
37
  import TimePickerViewCpn from './time-picker-view.vue';
38
38
 
39
39
  export default {
40
- name: 'AppTimePicker',
40
+ name: 'TimePicker',
41
41
  options: {
42
42
  virtualHost: true,
43
43
  styleIsolation: 'shared',
@@ -17,7 +17,7 @@ import ButtonCpn from '../button/button.vue';
17
17
  import UploadMixin from './mixin';
18
18
 
19
19
  export default {
20
- name: 'AppUploader',
20
+ name: 'Uploader',
21
21
  options: {
22
22
  virtualHost: true,
23
23
  styleIsolation: 'shared',
@@ -66,7 +66,7 @@ import LoadingCpn from '../loading/animations/loading-animation4.vue';
66
66
  import UploadMixin from './mixin';
67
67
 
68
68
  export default {
69
- name: 'AppUploader',
69
+ name: 'Uploader',
70
70
  options: {
71
71
  virtualHost: true,
72
72
  styleIsolation: 'shared',
@@ -9,7 +9,7 @@ import componentName from '../../mixins/componentName';
9
9
  import ButtonCpn from '../button/button.vue';
10
10
 
11
11
  export default {
12
- name: 'AppUploadButton',
12
+ name: 'UploadButton',
13
13
  options: {
14
14
  virtualHost: true,
15
15
  styleIsolation: 'shared',
@@ -40,7 +40,7 @@ import ButtonCpn from '../button/button.vue';
40
40
  import ImageCpn from '../image/image.vue';
41
41
 
42
42
  export default {
43
- name: 'AppUploader',
43
+ name: 'Uploader',
44
44
  options: {
45
45
  virtualHost: true,
46
46
  styleIsolation: 'shared',
package/configs/index.js CHANGED
@@ -12,6 +12,7 @@ const iconMap = new Map();
12
12
  /** 添加单个图标 */
13
13
  function addIconToMap(fontFamily, prefix, name) {
14
14
  if (iconMap.has(name)) {
15
+ // eslint-disable-next-line no-console
15
16
  console.error(
16
17
  `图标库 "${fontFamily}" 中的图标 "${name}" 在图标库 "${
17
18
  iconMap.get(name).fontFamily
@@ -17,7 +17,7 @@ export default {
17
17
  },
18
18
  /** 添加前缀后的组件名-大驼峰模式 */
19
19
  componentClass() {
20
- return this.componentPrefix + this.$options.name.replace(/^App/, '');
20
+ return this.componentPrefix + this.$options.name;
21
21
  },
22
22
  /** 添加前缀后的组件名-短横线模式 */
23
23
  componentKebabClass() {
@@ -25,7 +25,7 @@ export default {
25
25
  },
26
26
  /** 合并后的组件类名 */
27
27
  componentClassNames() {
28
- const baseClass = this.$style?.[this.$options.name.replace(/^App/, '')];
28
+ const baseClass = this.$style?.[this.$options.name];
29
29
  return [...(baseClass ? [baseClass] : []), this.componentClass, this.componentKebabClass];
30
30
  },
31
31
  },
package/package.json CHANGED
@@ -1,7 +1,10 @@
1
1
  {
2
2
  "name": "@ecolovo/uniapp-components",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Ecolovo UniApp 组件库",
5
+ "scripts": {
6
+ "lint": "eslint . --fix"
7
+ },
5
8
  "keywords": [
6
9
  "uniapp",
7
10
  "components"
@@ -11,5 +14,15 @@
11
14
  "dependencies": {
12
15
  "case-anything": "3.1.2",
13
16
  "lodash-es": "4.17.21"
17
+ },
18
+ "devDependencies": {
19
+ "@eslint/js": "^10.0.1",
20
+ "eslint": "^10.0.3",
21
+ "eslint-config-prettier": "^10.1.8",
22
+ "eslint-plugin-prettier": "^5.5.5",
23
+ "eslint-plugin-vue": "^10.8.0",
24
+ "globals": "^17.4.0",
25
+ "prettier": "^2.8.8",
26
+ "vue-eslint-parser": "^10.4.0"
14
27
  }
15
28
  }
@@ -3,7 +3,7 @@
3
3
  @use './utils' as *;
4
4
 
5
5
  page {
6
- @each $name, $value in $component-themes {
6
+ @each $name, $value in $themes {
7
7
  @for $i from 9 through 1 {
8
8
  #{DO_NOT_USE__global-var-name(theme, $name + '-dark' + $i)}: #{color.scale($value, $blackness: $i * 10%)};
9
9
  }
@@ -12,13 +12,13 @@ page {
12
12
  #{DO_NOT_USE__global-var-name(theme, $name + '-light' + $i)}: #{color.scale($value, $whiteness: $i * 10%)};
13
13
  }
14
14
  }
15
- @each $name, $value in $component-colors {
15
+ @each $name, $value in $colors {
16
16
  #{DO_NOT_USE__global-var-name(color, $name)}: #{$value};
17
17
  }
18
- @each $name, $value in $component-font-sizes {
18
+ @each $name, $value in $font-sizes {
19
19
  #{DO_NOT_USE__global-var-name(font-size, $name)}: #{$value};
20
20
  }
21
- @each $name, $value in $component-vars {
21
+ @each $name, $value in $others {
22
22
  #{DO_NOT_USE__global-var-name(other, $name)}: #{$value};
23
23
  }
24
24
  }
@@ -6,5 +6,5 @@
6
6
  @use './css-var' as *;
7
7
 
8
8
  @function UTILS__z-index($key: $component-name) {
9
- @return map.get($component-z-index-maps, $key);
9
+ @return map.get($z-index-maps, $key);
10
10
  }
@@ -2,39 +2,49 @@
2
2
 
3
3
  $component-prefix: 'app' !default;
4
4
 
5
- $component-z-index-maps: (
5
+ $z-index-maps: () !default;
6
+ $z-index-maps-default: (
6
7
  loading: 9999,
7
8
  dialog: 4000,
8
9
  dropdown: 3000,
9
10
  popover: 3000,
10
11
  page-header: 2000,
11
12
  page-footer: 2000,
12
- ) !default;
13
+ );
14
+ $z-index-maps: map.merge($z-index-maps-default, $z-index-maps);
13
15
 
14
- $component-themes: (
16
+ $themes: () !default;
17
+ $themes-default: (
15
18
  primary: #f26f24,
16
19
  secondary: #1e87e9,
17
20
  success: #6fe633,
18
21
  warning: #f3bb2d,
19
22
  danger: #ff0000,
20
23
  info: #9a9a99,
21
- ) !default;
24
+ );
25
+ $themes: map.merge($themes-default, $themes);
22
26
 
23
- $component-colors: (
27
+ $colors: () !default;
28
+ $colors-default: (
24
29
  foreground: #333,
25
30
  background: #f4f5f6,
26
31
  placeholder: #9a9a99,
27
32
  disabled: c3c4c5,
28
- ) !default;
33
+ );
34
+ $colors: map.merge($colors-default, $colors);
29
35
 
30
- $component-font-sizes: (
36
+ $font-sizes: () !default;
37
+ $font-sizes-default: (
31
38
  small: 24rpx,
32
39
  normal: 28rpx,
33
40
  large: 32rpx,
34
- ) !default;
41
+ );
42
+ $font-sizes: map.merge($font-sizes-default, $font-sizes);
35
43
 
36
- $component-vars: (
44
+ $others: () !default;
45
+ $others-default: (
37
46
  font-size-small: 24rpx,
38
47
  font-size-normal: 28rpx,
39
48
  font-size-large: 32rpx,
40
- ) !default;
49
+ );
50
+ $others: map.merge($others-default, $others);