uview-pro 0.3.5 → 0.3.7

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 (47) hide show
  1. package/changelog.md +46 -0
  2. package/components/u-calendar/types.ts +3 -2
  3. package/components/u-calendar/u-calendar.vue +2 -2
  4. package/components/u-checkbox/u-checkbox.vue +1 -1
  5. package/components/u-checkbox-group/types.ts +2 -1
  6. package/components/u-checkbox-group/u-checkbox-group.vue +1 -1
  7. package/components/u-city-select/u-city-select.vue +2 -2
  8. package/components/u-dropdown/types.ts +3 -2
  9. package/components/u-dropdown/u-dropdown.vue +1 -1
  10. package/components/u-form/u-form.vue +14 -9
  11. package/components/u-form-item/u-form-item.vue +9 -6
  12. package/components/u-index-anchor/u-index-anchor.vue +1 -1
  13. package/components/u-index-list/types.ts +2 -1
  14. package/components/u-index-list/u-index-list.vue +3 -3
  15. package/components/u-input/types.ts +5 -0
  16. package/components/u-input/u-input.vue +28 -8
  17. package/components/u-link/types.ts +2 -1
  18. package/components/u-message-input/types.ts +3 -2
  19. package/components/u-message-input/u-message-input.vue +1 -1
  20. package/components/u-modal/types.ts +3 -2
  21. package/components/u-modal/u-modal.vue +1 -1
  22. package/components/u-picker/types.ts +8 -2
  23. package/components/u-picker/u-picker.vue +276 -126
  24. package/components/u-radio/u-radio.vue +2 -2
  25. package/components/u-radio-group/types.ts +2 -1
  26. package/components/u-radio-group/u-radio-group.vue +1 -1
  27. package/components/u-read-more/types.ts +2 -1
  28. package/components/u-read-more/u-read-more.vue +1 -1
  29. package/components/u-select/types.ts +5 -2
  30. package/components/u-select/u-select.vue +56 -18
  31. package/components/u-slider/types.ts +3 -2
  32. package/components/u-slider/u-slider.vue +2 -2
  33. package/components/u-step/types.ts +29 -0
  34. package/components/u-step/u-step.vue +264 -0
  35. package/components/u-steps/types.ts +3 -2
  36. package/components/u-steps/u-steps.vue +17 -106
  37. package/components/u-switch/types.ts +2 -1
  38. package/components/u-switch/u-switch.vue +2 -2
  39. package/components/u-tabs/types.ts +3 -2
  40. package/components/u-tabs/u-tabs.vue +1 -1
  41. package/components/u-tabs-swiper/types.ts +3 -2
  42. package/components/u-tabs-swiper/u-tabs-swiper.vue +1 -1
  43. package/components/u-textarea/types.ts +88 -0
  44. package/components/u-textarea/u-textarea.vue +339 -0
  45. package/package.json +1 -1
  46. package/types/components.d.ts +2 -0
  47. package/types/global.d.ts +2 -0
@@ -42,7 +42,7 @@ import { SwitchProps } from './types';
42
42
  * @property {Boolean} loading 是否处于加载中(默认false)
43
43
  * @property {Boolean} disabled 是否禁用(默认false)
44
44
  * @property {String|Number} size 开关尺寸,单位rpx(默认50)
45
- * @property {String} active-color 打开时的背景色(默认#2979ff
45
+ * @property {String} active-color 打开时的背景色(默认主题色primary
46
46
  * @property {String} inactive-color 关闭时的背景色(默认#ffffff)
47
47
  * @property {Boolean|Number|String} active-value 打开选择器时通过change事件发出的值(默认true)
48
48
  * @property {Boolean|Number|String} inactive-value 关闭选择器时通过change事件发出的值(默认false)
@@ -137,7 +137,7 @@ function onClick() {
137
137
  }
138
138
 
139
139
  .u-switch--on {
140
- background-color: #1989fa;
140
+ background-color: $u-type-primary;
141
141
  }
142
142
 
143
143
  .u-switch--on .u-switch__node {
@@ -1,6 +1,7 @@
1
1
  import type { ExtractPropTypes, PropType } from 'vue';
2
2
  import type { TabsItem } from '../../types/global';
3
3
  import { baseProps } from '../common/props';
4
+ import { $u } from '../../';
4
5
 
5
6
  /**
6
7
  * TabsProps tabs标签 props 类型定义
@@ -21,9 +22,9 @@ export const TabsProps = {
21
22
  /** 过渡动画时长, 单位s */
22
23
  duration: { type: [String, Number] as PropType<number | string>, default: 0.5 },
23
24
  /** 选中项的主题颜色 */
24
- activeColor: { type: String, default: '#2979ff' },
25
+ activeColor: { type: String, default: $u.color.primary },
25
26
  /** 未选中项的颜色 */
26
- inactiveColor: { type: String, default: '#303133' },
27
+ inactiveColor: { type: String, default: $u.color.mainColor },
27
28
  /** 菜单底部移动的bar的宽度,单位rpx */
28
29
  barWidth: { type: [String, Number] as PropType<number | string>, default: 40 },
29
30
  /** 移动bar的高度 */
@@ -50,7 +50,7 @@ import { TabsProps } from './types';
50
50
  * @property {String|Number} height 导航栏的高度,单位rpx(默认80)
51
51
  * @property {String|Number} font-size tab文字大小,单位rpx(默认30)
52
52
  * @property {String|Number} duration 滑块移动一次所需的时间,单位秒(默认0.5)
53
- * @property {String} active-color 滑块和激活tab文字的颜色(默认#2979ff
53
+ * @property {String} active-color 滑块和激活tab文字的颜色(默认主题色primary
54
54
  * @property {String} inactive-color tabs文字颜色(默认#303133)
55
55
  * @property {String|Number} bar-width 滑块宽度,单位rpx(默认40)
56
56
  * @property {Object} active-item-style 活动tabs item的样式,对象形式
@@ -1,6 +1,7 @@
1
1
  import type { ExtractPropTypes, PropType } from 'vue';
2
2
  import type { TabsSwiperAutoCenterMode, TabsSwiperListItem } from '../../types/global';
3
3
  import { baseProps } from '../common/props';
4
+ import { $u } from '../../';
4
5
 
5
6
  /**
6
7
  * TabsSwiperProps 全屏选项卡 props 类型定义
@@ -21,9 +22,9 @@ export const TabsSwiperProps = {
21
22
  /** tabs组件外部swiper的宽度,单位rpx */
22
23
  swiperWidth: { type: [String, Number] as PropType<number | string>, default: 750 },
23
24
  /** 滑块和激活tab文字的颜色 */
24
- activeColor: { type: String, default: '#2979ff' },
25
+ activeColor: { type: String, default: $u.color.primary },
25
26
  /** tabs文字颜色 */
26
- inactiveColor: { type: String, default: '#303133' },
27
+ inactiveColor: { type: String, default: $u.color.mainColor },
27
28
  /** 滑块宽度,单位rpx */
28
29
  barWidth: { type: [Number, String] as PropType<number | string>, default: 40 },
29
30
  /** 滑块高度,单位rpx */
@@ -54,7 +54,7 @@ import { $u } from '../..';
54
54
  * @property {String|Number} height 导航栏的高度,单位rpx(默认80)
55
55
  * @property {String|Number} font-size tab文字大小,单位rpx(默认30)
56
56
  * @property {String|Number} swiper-width tabs组件外部swiper的宽度,默认为屏幕宽度,单位rpx(默认750)
57
- * @property {String} active-color 滑块和激活tab文字的颜色(默认#2979ff
57
+ * @property {String} active-color 滑块和激活tab文字的颜色(默认主题色primary
58
58
  * @property {String} inactive-color tabs文字颜色(默认#303133)
59
59
  * @property {String|Number} bar-width 滑块宽度,单位rpx(默认40)
60
60
  * @property {String|Number} bar-height 滑块高度,单位rpx(默认6)
@@ -0,0 +1,88 @@
1
+ import type { ExtractPropTypes, PropType } from 'vue';
2
+ import { baseProps } from '../common/props';
3
+
4
+ const textarea = {
5
+ value: '',
6
+ placeholder: '',
7
+ placeholderClass: 'input-placeholder',
8
+ placeholderStyle: 'color: #c0c4cc',
9
+ height: '100rpx',
10
+ confirmType: 'done',
11
+ disabled: false,
12
+ count: false,
13
+ focus: false,
14
+ autoHeight: false,
15
+ fixed: false,
16
+ cursorSpacing: 0,
17
+ cursor: '',
18
+ showConfirmBar: true,
19
+ selectionStart: -1,
20
+ selectionEnd: -1,
21
+ adjustPosition: true,
22
+ disableDefaultPadding: false,
23
+ holdKeyboard: false,
24
+ maxlength: 140,
25
+ border: 'surround',
26
+ formatter: null
27
+ };
28
+
29
+ export const TextareaProps = {
30
+ ...baseProps,
31
+ // 输入框的内容
32
+ modelValue: { type: [String, Number] as PropType<string | number>, default: textarea.value },
33
+ // 输入框为空时占位符
34
+ placeholder: { type: [String, Number] as PropType<string | number>, default: textarea.placeholder },
35
+ // 指定placeholder的样式类,注意页面或组件的style中写了scoped时,需要在类名前写/deep/
36
+ placeholderClass: { type: String as PropType<string>, default: textarea.placeholderClass },
37
+ // 指定placeholder的样式
38
+ placeholderStyle: {
39
+ type: [String, Object] as PropType<string | Record<string, any>>,
40
+ default: textarea.placeholderStyle
41
+ },
42
+ // 输入框高度
43
+ height: { type: [String, Number] as PropType<string | number>, default: textarea.height },
44
+ // 设置键盘右下角按钮的文字,仅微信小程序,App-vue和H5有效
45
+ confirmType: { type: String as PropType<string>, default: textarea.confirmType },
46
+ // 是否禁用
47
+ disabled: { type: Boolean as PropType<boolean>, default: textarea.disabled },
48
+ // 是否显示统计字数
49
+ count: { type: Boolean as PropType<boolean>, default: textarea.count },
50
+ // 是否自动获取焦点,nvue不支持,H5取决于浏览器的实现
51
+ focus: { type: Boolean as PropType<boolean>, default: textarea.focus },
52
+ // 是否自动增加高度
53
+ autoHeight: { type: Boolean as PropType<boolean>, default: textarea.autoHeight },
54
+ // 如果textarea是在一个position:fixed的区域,需要显示指定属性fixed为true
55
+ fixed: { type: Boolean as PropType<boolean>, default: textarea.fixed },
56
+ // 指定光标与键盘的距离
57
+ cursorSpacing: { type: Number as PropType<number>, default: textarea.cursorSpacing },
58
+ // 指定focus时的光标位置
59
+ cursor: { type: [String, Number] as PropType<string | number>, default: textarea.cursor },
60
+ // 是否显示键盘上方带有”完成“按钮那一栏,
61
+ showConfirmBar: { type: Boolean as PropType<boolean>, default: textarea.showConfirmBar },
62
+ // 光标起始位置,自动聚焦时有效,需与selection-end搭配使用
63
+ selectionStart: { type: Number as PropType<number>, default: textarea.selectionStart },
64
+ // 光标结束位置,自动聚焦时有效,需与selection-start搭配使用
65
+ selectionEnd: { type: Number as PropType<number>, default: textarea.selectionEnd },
66
+ // 键盘弹起时,是否自动上推页面
67
+ adjustPosition: { type: Boolean as PropType<boolean>, default: textarea.adjustPosition },
68
+ // 是否去掉 iOS 下的默认内边距,只微信小程序有效
69
+ disableDefaultPadding: { type: Boolean as PropType<boolean>, default: textarea.disableDefaultPadding },
70
+ // focus时,点击页面的时候不收起键盘,只微信小程序有效
71
+ holdKeyboard: { type: Boolean as PropType<boolean>, default: textarea.holdKeyboard },
72
+ // 最大输入长度,设置为 -1 的时候不限制最大长度
73
+ maxlength: { type: [String, Number] as PropType<string | number>, default: textarea.maxlength },
74
+ // 边框类型,surround-四周边框,bottom-底部边框
75
+ border: { type: [String, Boolean] as PropType<string | boolean>, default: textarea.border },
76
+ // 用于处理或者过滤输入框内容的方法
77
+ formatter: { type: Function as PropType<((val: any) => any) | null>, default: textarea.formatter },
78
+ // 是否忽略组件内对文本合成系统事件的处理
79
+ ignoreCompositionEvent: { type: Boolean as PropType<boolean>, default: true },
80
+ /** 是否可清空(默认true) */
81
+ clearable: { type: Boolean, default: true },
82
+ /** 输入框的验证状态,用于错误时,边框是否改为红色 */
83
+ validateState: { type: Boolean, default: false }
84
+ };
85
+
86
+ export type TextareaProps = ExtractPropTypes<typeof TextareaProps>;
87
+
88
+ export default TextareaProps;
@@ -0,0 +1,339 @@
1
+ <template>
2
+ <view
3
+ class="u-textarea"
4
+ :class="[
5
+ {
6
+ 'u-textarea--error': validateState
7
+ },
8
+ textareaClass,
9
+ customClass
10
+ ]"
11
+ :style="$u.toStyle(textareaStyle, customStyle)"
12
+ >
13
+ <textarea
14
+ class="u-textarea__field"
15
+ :value="innerValue"
16
+ :style="getStyle"
17
+ :placeholder="props.placeholder"
18
+ :placeholder-style="$u.toStyle(props.placeholderStyle)"
19
+ :placeholder-class="props.placeholderClass"
20
+ :disabled="props.disabled"
21
+ :focus="props.focus"
22
+ :autoHeight="props.autoHeight"
23
+ :fixed="props.fixed"
24
+ :cursorSpacing="props.cursorSpacing"
25
+ :cursor="props.cursor"
26
+ :showConfirmBar="props.showConfirmBar"
27
+ :selectionStart="props.selectionStart"
28
+ :selectionEnd="props.selectionEnd"
29
+ :adjustPosition="props.adjustPosition"
30
+ :disableDefaultPadding="props.disableDefaultPadding"
31
+ :holdKeyboard="props.holdKeyboard"
32
+ :maxlength="props.maxlength"
33
+ :confirmType="props.confirmType"
34
+ :ignoreCompositionEvent="props.ignoreCompositionEvent"
35
+ @focus="onFocus"
36
+ @blur="onBlur"
37
+ @linechange="onLinechange"
38
+ @input="onInput"
39
+ @confirm="onConfirm"
40
+ @keyboardheightchange="onKeyboardheightchange"
41
+ ></textarea>
42
+ <text
43
+ class="u-textarea__count"
44
+ :style="{
45
+ 'background-color': props.disabled ? 'transparent' : '#fff'
46
+ }"
47
+ v-if="props.count"
48
+ >
49
+ {{ innerValue.length }}/{{ props.maxlength }}
50
+ </text>
51
+
52
+ <view class="u-textarea__right-icon u-flex">
53
+ <view
54
+ class="u-textarea__right-icon__clear u-textarea__right-icon__item"
55
+ v-if="clearable && modelValue != '' && !disabled"
56
+ >
57
+ <u-icon size="32" name="close-circle-fill" color="#c0c4cc" @click="onClear" />
58
+ </view>
59
+ </view>
60
+ </view>
61
+ </template>
62
+
63
+ <script lang="ts">
64
+ export default {
65
+ name: 'u-textarea',
66
+ options: {
67
+ addGlobalClass: true,
68
+ // #ifndef MP-TOUTIAO
69
+ virtualHost: true,
70
+ // #endif
71
+ styleIsolation: 'shared'
72
+ }
73
+ };
74
+ </script>
75
+
76
+ <script setup lang="ts">
77
+ import { ref, computed, watch, nextTick } from 'vue';
78
+ import { TextareaProps } from './types';
79
+ import { $u, useChildren } from '../../';
80
+
81
+ /**
82
+ * Textarea 文本域
83
+ * @description 文本域此组件满足了可能出现的表单信息补充,编辑等实际逻辑的功能,内置了字数校验等
84
+ * @tutorial https://uviewpro.cn/zh/components/textarea.html
85
+ * @property {String | Number} value 输入框的内容
86
+ * @property {String | Number} placeholder 输入框为空时占位符
87
+ * @property {String} placeholderClass 指定placeholder的样式类,注意页面或组件的style中写了scoped时,需要在类名前写/deep/ ( 默认 'input-placeholder' )
88
+ * @property {String | Object} placeholderStyle 指定placeholder的样式,字符串/对象形式,如"color: red;"
89
+ * @property {String | Number} height 输入框高度(默认 70 )
90
+ * @property {String} confirmType 设置键盘右下角按钮的文字,仅微信小程序,App-vue和H5有效(默认 'done' )
91
+ * @property {Boolean} disabled 是否禁用(默认 false )
92
+ * @property {Boolean} count 是否显示统计字数(默认 false )
93
+ * @property {Boolean} focus 是否自动获取焦点,nvue不支持,H5取决于浏览器的实现(默认 false )
94
+ * @property {Boolean | Function} autoHeight 是否自动增加高度(默认 false )
95
+ * @property {Boolean} fixed 如果textarea是在一个position:fixed的区域,需要显示指定属性fixed为true(默认 false )
96
+ * @property {Number} cursorSpacing 指定光标与键盘的距离(默认 0 )
97
+ * @property {String | Number} cursor 指定focus时的光标位置
98
+ * @property {Function} formatter 内容式化函数
99
+ * @property {Boolean} showConfirmBar 是否显示键盘上方带有”完成“按钮那一栏,(默认 true )
100
+ * @property {Number} selectionStart 光标起始位置,自动聚焦时有效,需与selection-end搭配使用,(默认 -1 )
101
+ * @property {Number | Number} selectionEnd 光标结束位置,自动聚焦时有效,需与selection-start搭配使用(默认 -1 )
102
+ * @property {Boolean} adjustPosition 键盘弹起时,是否自动上推页面(默认 true )
103
+ * @property {Boolean | Number} disableDefaultPadding 是否去掉 iOS 下的默认内边距,只微信小程序有效(默认 false )
104
+ * @property {Boolean} holdKeyboard focus时,点击页面的时候不收起键盘,只微信小程序有效(默认 false )
105
+ * @property {String | Number} maxlength 最大输入长度,设置为 -1 的时候不限制最大长度(默认 140 )
106
+ * @property {String} border 边框类型,surround-四周边框,none-无边框,bottom-底部边框(默认 'surround' )
107
+ * @property {Boolean} ignoreCompositionEvent 是否忽略组件内对文本合成系统事件的处理
108
+ * @event {Function(e)} focus 输入框聚焦时触发,event.detail = { value, height },height 为键盘高度
109
+ * @event {Function(e)} blur 输入框失去焦点时触发,event.detail = {value, cursor}
110
+ * @event {Function(e)} linechange 输入框行数变化时调用,event.detail = {height: 0, heightRpx: 0, lineCount: 0}
111
+ * @event {Function(e)} input 当键盘输入时,触发 input 事件
112
+ * @event {Function(e)} confirm 点击完成时, 触发 confirm 事件
113
+ * @event {Function(e)} keyboardheightchange 键盘高度发生变化的时候触发此事件
114
+ * @example <u-textarea v-model="value1" placeholder="请输入内容" ></u-textarea>
115
+ */
116
+
117
+ const props = defineProps(TextareaProps);
118
+ const emit = defineEmits([
119
+ 'update:modelValue',
120
+ 'focus',
121
+ 'blur',
122
+ 'linechange',
123
+ 'input',
124
+ 'confirm',
125
+ 'keyboardheightchange',
126
+ 'change'
127
+ ]);
128
+
129
+ const { emitToParent } = useChildren('u-textarea', 'u-form-item');
130
+
131
+ // state
132
+ const innerValue = ref('');
133
+ const focused = ref(false);
134
+ const firstChange = ref(true);
135
+ const changeFromInner = ref(false);
136
+ const innerFormatter = ref((v: any) => v);
137
+ const validateState = ref(props.validateState); // 当前input的验证状态,用于错误时,边框是否改为红色
138
+
139
+ // watch value prop
140
+ watch(
141
+ () => props.modelValue,
142
+ (newVal: any) => {
143
+ innerValue.value = newVal;
144
+ /* #ifdef H5 */
145
+ // 在H5中,外部value变化后,修改input中的值,不会触发@input事件,此时手动调用值变化方法
146
+ if (firstChange.value === false && changeFromInner.value === false) {
147
+ valueChange();
148
+ }
149
+ /* #endif */
150
+ firstChange.value = false;
151
+ // 重置changeFromInner的值为false,标识下一次引起默认为外部引起的
152
+ changeFromInner.value = false;
153
+ },
154
+ { immediate: true }
155
+ );
156
+
157
+ // 监听 validateState 变化
158
+ watch(
159
+ () => props.validateState,
160
+ val => {
161
+ validateState.value = val;
162
+ }
163
+ );
164
+
165
+ // 组件的类名
166
+ const textareaClass = computed(() => {
167
+ let classes: string[] = [];
168
+ if (props.border) {
169
+ if (props.border === 'surround') {
170
+ classes = classes.concat(['u-textarea--border', 'u-textarea--radius']);
171
+ } else if (props.border === 'bottom') {
172
+ classes = classes.concat(['u-border-bottom', 'u-textarea--no-radius']);
173
+ } else {
174
+ classes = classes.concat(['u-textarea--border', 'u-textarea--radius']);
175
+ }
176
+ }
177
+ props.disabled && classes.push('u-textarea--disabled');
178
+ return classes.join(' ');
179
+ });
180
+
181
+ // 组件的样式
182
+ const textareaStyle = computed(() => {
183
+ const style: Record<string, any> = {};
184
+ if (props.border) {
185
+ style.padding = `${props.border ? 20 : 0}rpx`;
186
+ }
187
+ // #ifdef APP-NVUE
188
+ if ($u.os() === 'android') {
189
+ style.paddingTop = '6px';
190
+ style.paddingLeft = '9px';
191
+ style.paddingBottom = '3px';
192
+ style.paddingRight = '6px';
193
+ }
194
+ // #endif
195
+ return style;
196
+ });
197
+
198
+ const getStyle = computed(() => {
199
+ let style: Record<string, any> = {};
200
+ // 如果没有自定义高度,就根据textarea来分配一个默认的高度
201
+ if (props.autoHeight) {
202
+ style.minHeight = $u.addUnit(props.height || '100rpx');
203
+ style.height = 'auto';
204
+ } else {
205
+ style.height = $u.addUnit(props.height);
206
+ }
207
+ return $u.toStyle(style, props.customStyle);
208
+ });
209
+
210
+ function onFormItemError(status: boolean) {
211
+ validateState.value = status;
212
+ }
213
+
214
+ // methods
215
+ function setFormatter(e: any) {
216
+ innerFormatter.value = e;
217
+ }
218
+
219
+ function onFocus(e: any) {
220
+ emit('focus', e);
221
+ }
222
+
223
+ function onBlur(e: any) {
224
+ setTimeout(() => {
225
+ e.detail.value = innerValue.value;
226
+ let value = e.detail.value;
227
+ emit('blur', e);
228
+ emitToParent('onFormBlur', value);
229
+ }, 40);
230
+ }
231
+
232
+ function onLinechange(e: any) {
233
+ emit('linechange', e);
234
+ }
235
+
236
+ function onInput(e: any) {
237
+ let { value = '' } = e.detail || {};
238
+ // 格式化过滤方法
239
+ const formatter = props.formatter || innerFormatter.value;
240
+ const formatValue = typeof formatter === 'function' ? formatter(value) : value;
241
+ // 为了避免props的单向数据流特性,需要先将innerValue值设置为当前值,再在$nextTick中重新赋予设置后的值才有效
242
+ innerValue.value = value;
243
+ nextTick(() => {
244
+ innerValue.value = formatValue;
245
+ valueChange();
246
+ });
247
+ }
248
+
249
+ function valueChange() {
250
+ const value = innerValue.value;
251
+ nextTick(() => {
252
+ emit('input', value);
253
+ emit('update:modelValue', value);
254
+ // 标识value值的变化是由内部引起的
255
+ changeFromInner.value = true;
256
+ emit('change', value);
257
+ emitToParent('onFormChange', value);
258
+ });
259
+ }
260
+
261
+ function onConfirm(e: any) {
262
+ emit('confirm', e);
263
+ }
264
+
265
+ function onKeyboardheightchange(e: any) {
266
+ emit('keyboardheightchange', e);
267
+ }
268
+ function onClear(event: any) {
269
+ try {
270
+ event.stopPropagation();
271
+ } catch (e) {
272
+ console.log(e);
273
+ }
274
+ innerValue.value = '';
275
+ valueChange();
276
+ }
277
+
278
+ defineExpose({
279
+ onFormItemError
280
+ });
281
+ </script>
282
+
283
+ <style lang="scss" scoped>
284
+ @import '../../libs/css/style.components.scss';
285
+
286
+ .u-textarea {
287
+ border-radius: 4px;
288
+ background-color: #fff;
289
+ position: relative;
290
+ @include flex;
291
+ flex: 1;
292
+
293
+ &--border {
294
+ border-radius: 4px;
295
+ border: 1px solid $u-form-item-border-color;
296
+ }
297
+
298
+ &--error {
299
+ border-color: $u-type-error !important;
300
+ }
301
+
302
+ &--radius {
303
+ border-radius: 4px;
304
+ }
305
+
306
+ &--no-radius {
307
+ border-radius: 0;
308
+ }
309
+
310
+ &--disabled {
311
+ background-color: #f5f7fa;
312
+ }
313
+
314
+ &__field {
315
+ flex: 1;
316
+ font-size: 28rpx;
317
+ color: $u-content-color;
318
+ width: 100%;
319
+ }
320
+
321
+ &__count {
322
+ position: absolute;
323
+ right: 1px;
324
+ bottom: 0;
325
+ font-size: 12px;
326
+ color: $u-tips-color;
327
+ background-color: #ffffff;
328
+ padding: 1px 4px;
329
+ border-radius: 10px;
330
+ line-height: 16px;
331
+ }
332
+
333
+ &__right-icon {
334
+ &__item {
335
+ margin-left: 10rpx;
336
+ }
337
+ }
338
+ }
339
+ </style>
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "id": "uview-pro",
3
3
  "name": "uview-pro",
4
4
  "displayName": "【Vue3重构版】uView Pro|基于Vue3+TS全面重构的70+精选UI组件库",
5
- "version": "0.3.5",
5
+ "version": "0.3.7",
6
6
  "description": "uView Pro,是全面支持Vue3的uni-app生态框架,70+精选组件已使用TypeScript重构,已全面支持uni-app Vue3.0",
7
7
  "main": "index.ts",
8
8
  "module": "index.ts",
@@ -68,6 +68,7 @@ declare module 'vue' {
68
68
  uSelect: (typeof import('../components/u-select/u-select.vue'))['default'];
69
69
  uSkeleton: (typeof import('../components/u-skeleton/u-skeleton.vue'))['default'];
70
70
  uSlider: (typeof import('../components/u-slider/u-slider.vue'))['default'];
71
+ uStep: (typeof import('../components/u-steps/u-step.vue'))['default'];
71
72
  uSteps: (typeof import('../components/u-steps/u-steps.vue'))['default'];
72
73
  uSticky: (typeof import('../components/u-sticky/u-sticky.vue'))['default'];
73
74
  uSubsection: (typeof import('../components/u-subsection/u-subsection.vue'))['default'];
@@ -93,6 +94,7 @@ declare module 'vue' {
93
94
  uRootPortal: (typeof import('../components/u-root-portal/u-root-portal.vue'))['default'];
94
95
  uStatusBar: (typeof import('../components/u-status-bar/u-status-bar.vue'))['default'];
95
96
  uSafeBottom: (typeof import('../components/u-safe-bottom/u-safe-bottom.vue'))['default'];
97
+ uTextarea: (typeof import('../components/u-textarea/u-textarea.vue'))['default'];
96
98
  }
97
99
  }
98
100
 
package/types/global.d.ts CHANGED
@@ -233,6 +233,8 @@ export type SelectListItem = {
233
233
  // Step 组件 mode
234
234
  export type StepsListItem = {
235
235
  name: string;
236
+ icon?: string;
237
+ desc?: string;
236
238
  [key: string]: any;
237
239
  };
238
240
  // Step 组件 mode