@10yun/cv-mobile-ui 0.4.1 → 0.4.2
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.
- package/package.json +1 -1
- package/ui-cv/cv-badge/{uni-badge.vue → cv-badge.vue} +2 -2
- package/ui-cv/cv-calendar/calendar.js +762 -345
- package/ui-cv/cv-calendar/cv-calendar-item.vue +198 -0
- package/ui-cv/cv-calendar/cv-calendar.vue +508 -0
- package/ui-cv/cv-card/cv-card.vue +427 -0
- package/ui-cv/cv-col/cv-col.vue +2965 -0
- package/ui-cv/cv-collapse/cv-collapse.vue +146 -0
- package/ui-cv/cv-collapse-item/cv-collapse-item.vue +395 -0
- package/ui-cv/cv-combox/cv-combox.vue +250 -0
- package/ui-cv/cv-countdown/cv-countdown.vue +245 -0
- package/ui-cv/cv-data-checkbox/cv-data-checkbox.vue +841 -0
- package/ui-cv/cv-data-indexed-list/cv-data-indexed-list-item.vue +154 -0
- package/ui-cv/cv-data-indexed-list/cv-data-indexed-list.vue +376 -0
- package/ui-cv/cv-data-picker/cv-data-picker.vue +486 -0
- package/ui-cv/cv-data-pickerview/{uni-data-picker.js → cv-data-picker.js} +0 -0
- package/ui-cv/cv-data-pickerview/cv-data-pickerview.vue +304 -0
- package/ui-cv/cv-dateformat/cv-dateformat.vue +86 -0
- package/ui-cv/cv-datetime-picker/calendar.vue +752 -738
- package/ui-cv/cv-datetime-picker/cv-datetime-picker.vue +958 -0
- package/ui-cv/cv-datetime-picker/time-picker.vue +900 -892
- package/ui-cv/cv-easyinput/cv-easyinput.vue +514 -0
- package/ui-cv/cv-fab/cv-fab.vue +465 -0
- package/ui-cv/cv-fab/{uni-fab.vue.bak → cv-fab.vue.bak} +2 -2
- package/ui-cv/cv-fav/cv-fav.vue +150 -0
- package/ui-cv/cv-file-picker/cv-file-picker.vue +619 -0
- package/ui-cv/cv-form-item/cv-form-item.vue +1 -1
- package/ui-cv/cv-goods-nav/{uni-goods-nav.vue → cv-goods-nav.vue} +1 -1
- package/ui-cv/{cv-icons2/cv-icons2.vue → cv-icon2/cv-icon2.vue} +3 -3
- package/ui-cv/{cv-icons2 → cv-icon2}/icons.js +0 -0
- package/ui-cv/{cv-icons2 → cv-icon2}/uni.ttf +0 -0
- package/ui-cv/cv-indexed-list/cv-indexed-list-item.vue +154 -0
- package/ui-cv/cv-indexed-list/cv-indexed-list.vue +371 -0
- package/ui-cv/cv-input-password/cv-input-password.vue +2 -2
- package/ui-cv/{cv-link/uni-link.vue → cv-link2/cv-link2.vue} +1 -1
- package/ui-cv/cv-list/cv-list.vue +107 -0
- package/ui-cv/cv-list/cv-refresh.vue +65 -0
- package/ui-cv/cv-list-ad/cv-list-ad.vue +113 -0
- package/ui-cv/cv-list-chat/{uni-list-chat.scss → cv-list-chat.scss} +0 -0
- package/ui-cv/cv-list-chat/{uni-list-chat.vue → cv-list-chat.vue} +0 -0
- package/ui-cv/cv-list-item/cv-list-item.vue +449 -0
- package/ui-cv/cv-nav-bar/cv-nav-bar.vue +256 -0
- package/ui-cv/cv-nav-bar/{uni-status-bar.vue → cv-status-bar.vue} +0 -0
- package/ui-cv/cv-notice-bar/cv-notice-bar.vue +453 -0
- package/ui-cv/cv-number-box/cv-number-box.vue +223 -0
- package/ui-cv/cv-pagination/cv-pagination.vue +397 -0
- package/ui-cv/cv-popup/cv-popup.vue +429 -0
- package/ui-cv/cv-popup-dialog/{uni-popup-dialog.vue → cv-popup-dialog.vue} +0 -0
- package/ui-cv/cv-popup-message/cv-popup-message.vue +143 -0
- package/ui-cv/cv-popup-share/{uni-popup-share.vue → cv-popup-share.vue} +0 -0
- package/ui-cv/cv-row/{uni-row.vue → cv-row.vue} +1 -1
- package/ui-cv/cv-search-bar/cv-search-bar.vue +280 -0
- package/ui-cv/cv-section/{uni-section.vue → cv-section.vue} +0 -0
- package/ui-cv/cv-segmented-control/{uni-segmented-control.vue → cv-segmented-control.vue} +0 -0
- package/ui-cv/cv-status-bar/{uni-status-bar.vue → cv-status-bar.vue} +0 -0
- package/ui-cv/cv-steps/cv-steps.vue +293 -0
- package/ui-cv/cv-swipe-action/{uni-swipe-action.vue → cv-swipe-action.vue} +0 -0
- package/ui-cv/cv-swipe-action-item/{uni-swipe-action-item.vue → cv-swipe-action-item.vue} +0 -0
- package/ui-cv/cv-swiper-dot/cv-swiper-dot.vue +255 -0
- package/ui-cv/cv-table/cv-table.vue +460 -0
- package/ui-cv/cv-tag/cv-tag.vue +276 -0
- package/ui-cv/cv-tbody/cv-tbody.vue +28 -0
- package/ui-cv/cv-td/cv-td.vue +93 -0
- package/ui-cv/cv-test/{uni-test.vue → cv-test.vue} +0 -0
- package/ui-cv/cv-th/cv-th.vue +270 -0
- package/ui-cv/cv-thead/cv-thead.vue +114 -0
- package/ui-cv/cv-title/cv-title.vue +168 -0
- package/ui-cv/cv-tr/cv-tr.vue +166 -0
- package/ui-cv/cv-transition/cv-transition.vue +279 -0
- package/ui-cv/cv-calendar/uni-calendar-item.vue +0 -171
- package/ui-cv/cv-calendar/uni-calendar.vue +0 -504
- package/ui-cv/cv-card/uni-card.vue +0 -420
- package/ui-cv/cv-col/uni-col.vue +0 -2968
- package/ui-cv/cv-collapse/uni-collapse.vue +0 -146
- package/ui-cv/cv-collapse-item/uni-collapse-item.vue +0 -378
- package/ui-cv/cv-combox/uni-combox.vue +0 -237
- package/ui-cv/cv-countdown/uni-countdown.vue +0 -234
- package/ui-cv/cv-data-checkbox/uni-data-checkbox.vue +0 -792
- package/ui-cv/cv-data-indexed-list/uni-data-indexed-list-item.vue +0 -142
- package/ui-cv/cv-data-indexed-list/uni-data-indexed-list.vue +0 -364
- package/ui-cv/cv-data-picker/uni-data-picker.vue +0 -468
- package/ui-cv/cv-data-pickerview/uni-data-pickerview.vue +0 -298
- package/ui-cv/cv-dateformat/uni-dateformat.vue +0 -88
- package/ui-cv/cv-datetime-picker/uni-datetime-picker.vue +0 -874
- package/ui-cv/cv-easyinput/uni-easyinput.vue +0 -438
- package/ui-cv/cv-fab/uni-fab.vue +0 -443
- package/ui-cv/cv-fav/uni-fav.vue +0 -136
- package/ui-cv/cv-file-picker/uni-file-picker.vue +0 -614
- package/ui-cv/cv-indexed-list/uni-indexed-list-item.vue +0 -142
- package/ui-cv/cv-indexed-list/uni-indexed-list.vue +0 -357
- package/ui-cv/cv-list/uni-list.vue +0 -107
- package/ui-cv/cv-list/uni-refresh.vue +0 -65
- package/ui-cv/cv-list-ad/uni-list-ad.vue +0 -106
- package/ui-cv/cv-list-item/uni-list-item.vue +0 -428
- package/ui-cv/cv-nav-bar/uni-nav-bar.vue +0 -244
- package/ui-cv/cv-notice-bar/uni-notice-bar.vue +0 -394
- package/ui-cv/cv-number-box/uni-number-box.vue +0 -224
- package/ui-cv/cv-pagination/uni-pagination.vue +0 -376
- package/ui-cv/cv-popup/uni-popup.vue +0 -412
- package/ui-cv/cv-popup-message/uni-popup-message.vue +0 -143
- package/ui-cv/cv-search-bar/uni-search-bar.vue +0 -262
- package/ui-cv/cv-steps/uni-steps.vue +0 -250
- package/ui-cv/cv-swiper-dot/uni-swiper-dot.vue +0 -205
- package/ui-cv/cv-table/uni-table.vue +0 -455
- package/ui-cv/cv-tag/uni-tag.vue +0 -283
- package/ui-cv/cv-tbody/uni-tbody.vue +0 -30
- package/ui-cv/cv-td/uni-td.vue +0 -88
- package/ui-cv/cv-th/uni-th.vue +0 -259
- package/ui-cv/cv-thead/uni-thead.vue +0 -114
- package/ui-cv/cv-title/uni-title.vue +0 -171
- package/ui-cv/cv-tr/uni-tr.vue +0 -156
- package/ui-cv/cv-transition/uni-transition.vue +0 -287
|
@@ -1,438 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="uni-easyinput" :class="{'uni-easyinput-error':msg}" :style="{color:inputBorder && msg?'#dd524d':styles.color}">
|
|
3
|
-
<view class="uni-easyinput__content" :class="{'is-input-border':inputBorder ,'is-input-error-border':inputBorder && msg,'is-textarea':type==='textarea','is-disabled':disabled}" :style="{'border-color':inputBorder && msg?'#dd524d':styles.borderColor,'background-color':disabled?styles.disableColor:''}">
|
|
4
|
-
<uni-icons v-if="prefixIcon" class="content-clear-icon" :type="prefixIcon" color="#c0c4cc" @click="onClickIcon('prefix')"></uni-icons>
|
|
5
|
-
<textarea v-if="type === 'textarea'" class="uni-easyinput__content-textarea" :class="{'input-padding':inputBorder}" :name="name" :value="val" :placeholder="placeholder" :placeholderStyle="placeholderStyle" :disabled="disabled" :maxlength="inputMaxlength" :focus="focused" :autoHeight="autoHeight" @input="onInput" @blur="onBlur" @focus="onFocus" @confirm="onConfirm"></textarea>
|
|
6
|
-
<input v-else :type="type === 'password'?'text':type" class="uni-easyinput__content-input" :style="{
|
|
7
|
-
'padding-right':type === 'password' ||clearable || prefixIcon?'':'10px',
|
|
8
|
-
'padding-left':prefixIcon?'':'10px'
|
|
9
|
-
}" :name="name" :value="val" :password="!showPassword && type === 'password'" :placeholder="placeholder" :placeholderStyle="placeholderStyle" :disabled="disabled" :maxlength="inputMaxlength" :focus="focused" :confirmType="confirmType" @focus="onFocus" @blur="onBlur" @input="onInput" @confirm="onConfirm" />
|
|
10
|
-
<template v-if="type === 'password' && passwordIcon">
|
|
11
|
-
<uni-icons v-if="val != '' " class="content-clear-icon" :class="{'is-textarea-icon':type==='textarea'}" :type="showPassword?'eye-slash-filled':'eye-filled'" :size="18" color="#c0c4cc" @click="onEyes"></uni-icons>
|
|
12
|
-
</template>
|
|
13
|
-
<template v-else-if="suffixIcon">
|
|
14
|
-
<uni-icons v-if="suffixIcon" class="content-clear-icon" :type="suffixIcon" color="#c0c4cc" @click="onClickIcon('suffix')"></uni-icons>
|
|
15
|
-
</template>
|
|
16
|
-
<template v-else>
|
|
17
|
-
<uni-icons class="content-clear-icon" :class="{'is-textarea-icon':type==='textarea'}" type="clear" :size="clearSize" v-if="clearable && val && !disabled" color="#c0c4cc" @click="onClear"></uni-icons>
|
|
18
|
-
</template>
|
|
19
|
-
<slot name="right"></slot>
|
|
20
|
-
</view>
|
|
21
|
-
</view>
|
|
22
|
-
</template>
|
|
23
|
-
|
|
24
|
-
<script>
|
|
25
|
-
// import {
|
|
26
|
-
// debounce,
|
|
27
|
-
// throttle
|
|
28
|
-
// } from './common.js'
|
|
29
|
-
/**
|
|
30
|
-
* Easyinput 输入框
|
|
31
|
-
* @description 此组件可以实现表单的输入与校验,包括 "text" 和 "textarea" 类型。
|
|
32
|
-
* @tutorial https://ext.dcloud.net.cn/plugin?id=3455
|
|
33
|
-
* @property {String} value 输入内容
|
|
34
|
-
* @property {String } type 输入框的类型(默认text) password/text/textarea/..
|
|
35
|
-
* @value text 文本输入键盘
|
|
36
|
-
* @value textarea 多行文本输入键盘
|
|
37
|
-
* @value password 密码输入键盘
|
|
38
|
-
* @value number 数字输入键盘,注意iOS上app-vue弹出的数字键盘并非9宫格方式
|
|
39
|
-
* @value idcard 身份证输入键盘,信、支付宝、百度、QQ小程序
|
|
40
|
-
* @value digit 带小数点的数字键盘 ,App的nvue页面、微信、支付宝、百度、头条、QQ小程序支持
|
|
41
|
-
* @property {Boolean} clearable 是否显示右侧清空内容的图标控件,点击可清空输入框内容(默认true)
|
|
42
|
-
* @property {Boolean} autoHeight 是否自动增高输入区域,type为textarea时有效(默认true)
|
|
43
|
-
* @property {String } placeholder 输入框的提示文字
|
|
44
|
-
* @property {String } placeholderStyle placeholder的样式(内联样式,字符串),如"color: #ddd"
|
|
45
|
-
* @property {Boolean} focus 是否自动获得焦点(默认false)
|
|
46
|
-
* @property {Boolean} disabled 是否禁用(默认false)
|
|
47
|
-
* @property {Number } maxlength 最大输入长度,设置为 -1 的时候不限制最大长度(默认140)
|
|
48
|
-
* @property {String } confirmType 设置键盘右下角按钮的文字,仅在type="text"时生效(默认done)
|
|
49
|
-
* @property {Number } clearSize 清除图标的大小,单位px(默认15)
|
|
50
|
-
* @property {String} prefixIcon 输入框头部图标
|
|
51
|
-
* @property {String} suffixIcon 输入框尾部图标
|
|
52
|
-
* @property {Boolean} trim 是否自动去除两端的空格
|
|
53
|
-
* @value both 去除两端空格
|
|
54
|
-
* @value left 去除左侧空格
|
|
55
|
-
* @value right 去除右侧空格
|
|
56
|
-
* @value start 去除左侧空格
|
|
57
|
-
* @value end 去除右侧空格
|
|
58
|
-
* @value all 去除全部空格
|
|
59
|
-
* @value none 不去除空格
|
|
60
|
-
* @property {Boolean} inputBorder 是否显示input输入框的边框(默认true)
|
|
61
|
-
* @property {Boolean} passwordIcon type=password时是否显示小眼睛图标
|
|
62
|
-
* @property {Object} styles 自定义颜色
|
|
63
|
-
* @event {Function} input 输入框内容发生变化时触发
|
|
64
|
-
* @event {Function} focus 输入框获得焦点时触发
|
|
65
|
-
* @event {Function} blur 输入框失去焦点时触发
|
|
66
|
-
* @event {Function} confirm 点击完成按钮时触发
|
|
67
|
-
* @event {Function} iconClick 点击图标时触发
|
|
68
|
-
* @example <uni-easyinput v-model="mobile"></uni-easyinput>
|
|
69
|
-
*/
|
|
70
|
-
|
|
71
|
-
export default {
|
|
72
|
-
name: 'uni-easyinput',
|
|
73
|
-
emits: ['click', 'iconClick', 'update:modelValue', 'input', 'focus', 'blur', 'confirm'],
|
|
74
|
-
model: {
|
|
75
|
-
prop: 'modelValue',
|
|
76
|
-
event: 'update:modelValue'
|
|
77
|
-
},
|
|
78
|
-
props: {
|
|
79
|
-
name: String,
|
|
80
|
-
value: [Number, String],
|
|
81
|
-
modelValue: [Number, String],
|
|
82
|
-
type: {
|
|
83
|
-
type: String,
|
|
84
|
-
default: 'text'
|
|
85
|
-
},
|
|
86
|
-
clearable: {
|
|
87
|
-
type: Boolean,
|
|
88
|
-
default: true
|
|
89
|
-
},
|
|
90
|
-
autoHeight: {
|
|
91
|
-
type: Boolean,
|
|
92
|
-
default: false
|
|
93
|
-
},
|
|
94
|
-
placeholder: String,
|
|
95
|
-
placeholderStyle: String,
|
|
96
|
-
focus: {
|
|
97
|
-
type: Boolean,
|
|
98
|
-
default: false
|
|
99
|
-
},
|
|
100
|
-
disabled: {
|
|
101
|
-
type: Boolean,
|
|
102
|
-
default: false
|
|
103
|
-
},
|
|
104
|
-
maxlength: {
|
|
105
|
-
type: [Number, String],
|
|
106
|
-
default: 140
|
|
107
|
-
},
|
|
108
|
-
confirmType: {
|
|
109
|
-
type: String,
|
|
110
|
-
default: 'done'
|
|
111
|
-
},
|
|
112
|
-
clearSize: {
|
|
113
|
-
type: [Number, String],
|
|
114
|
-
default: 15
|
|
115
|
-
},
|
|
116
|
-
inputBorder: {
|
|
117
|
-
type: Boolean,
|
|
118
|
-
default: true
|
|
119
|
-
},
|
|
120
|
-
prefixIcon: {
|
|
121
|
-
type: String,
|
|
122
|
-
default: ''
|
|
123
|
-
},
|
|
124
|
-
suffixIcon: {
|
|
125
|
-
type: String,
|
|
126
|
-
default: ''
|
|
127
|
-
},
|
|
128
|
-
trim: {
|
|
129
|
-
type: [Boolean, String],
|
|
130
|
-
default: true
|
|
131
|
-
},
|
|
132
|
-
passwordIcon: {
|
|
133
|
-
type: Boolean,
|
|
134
|
-
default: true
|
|
135
|
-
},
|
|
136
|
-
styles: {
|
|
137
|
-
type: Object,
|
|
138
|
-
default () {
|
|
139
|
-
return {
|
|
140
|
-
color: '#333',
|
|
141
|
-
disableColor: '#eee',
|
|
142
|
-
borderColor: '#e5e5e5'
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
},
|
|
146
|
-
errorMessage: {
|
|
147
|
-
type: [String, Boolean],
|
|
148
|
-
default: ''
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
data() {
|
|
152
|
-
return {
|
|
153
|
-
focused: false,
|
|
154
|
-
errMsg: '',
|
|
155
|
-
val: '',
|
|
156
|
-
showMsg: '',
|
|
157
|
-
border: false,
|
|
158
|
-
isFirstBorder: false,
|
|
159
|
-
showClearIcon: false,
|
|
160
|
-
showPassword: false
|
|
161
|
-
};
|
|
162
|
-
},
|
|
163
|
-
computed: {
|
|
164
|
-
msg() {
|
|
165
|
-
return this.errorMessage || this.errMsg;
|
|
166
|
-
},
|
|
167
|
-
// 因为uniapp的input组件的maxlength组件必须要数值,这里转为数值,给用户可以传入字符串数值
|
|
168
|
-
inputMaxlength() {
|
|
169
|
-
return Number(this.maxlength);
|
|
170
|
-
},
|
|
171
|
-
},
|
|
172
|
-
watch: {
|
|
173
|
-
value(newVal) {
|
|
174
|
-
if (this.errMsg) this.errMsg = ''
|
|
175
|
-
this.val = newVal
|
|
176
|
-
if (this.form && this.formItem) {
|
|
177
|
-
this.formItem.setValue(newVal)
|
|
178
|
-
}
|
|
179
|
-
},
|
|
180
|
-
modelValue(newVal) {
|
|
181
|
-
if (this.errMsg) this.errMsg = ''
|
|
182
|
-
this.val = newVal
|
|
183
|
-
if (this.form && this.formItem) {
|
|
184
|
-
this.formItem.setValue(newVal)
|
|
185
|
-
}
|
|
186
|
-
},
|
|
187
|
-
focus(newVal) {
|
|
188
|
-
this.$nextTick(() => {
|
|
189
|
-
this.focused = this.focus
|
|
190
|
-
})
|
|
191
|
-
}
|
|
192
|
-
},
|
|
193
|
-
created() {
|
|
194
|
-
if (!this.value) {
|
|
195
|
-
this.val = this.modelValue
|
|
196
|
-
}
|
|
197
|
-
if (!this.modelValue) {
|
|
198
|
-
this.val = this.value
|
|
199
|
-
}
|
|
200
|
-
this.form = this.getForm('uniForms')
|
|
201
|
-
this.formItem = this.getForm('uniFormsItem')
|
|
202
|
-
if (this.form && this.formItem) {
|
|
203
|
-
if (this.formItem.name) {
|
|
204
|
-
this.rename = this.formItem.name
|
|
205
|
-
this.form.inputChildrens.push(this)
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
},
|
|
209
|
-
mounted() {
|
|
210
|
-
// this.onInput = throttle(this.input, 500)
|
|
211
|
-
this.$nextTick(() => {
|
|
212
|
-
// setTimeout(()=>{
|
|
213
|
-
// },1000)
|
|
214
|
-
this.focused = this.focus
|
|
215
|
-
})
|
|
216
|
-
},
|
|
217
|
-
methods: {
|
|
218
|
-
/**
|
|
219
|
-
* 初始化变量值
|
|
220
|
-
*/
|
|
221
|
-
init() {
|
|
222
|
-
|
|
223
|
-
},
|
|
224
|
-
onClickIcon(type) {
|
|
225
|
-
this.$emit('iconClick', type)
|
|
226
|
-
},
|
|
227
|
-
/**
|
|
228
|
-
* 获取父元素实例
|
|
229
|
-
*/
|
|
230
|
-
getForm(name = 'uniForms') {
|
|
231
|
-
let parent = this.$parent;
|
|
232
|
-
let parentName = parent.$options.name;
|
|
233
|
-
while (parentName !== name) {
|
|
234
|
-
parent = parent.$parent;
|
|
235
|
-
if (!parent) return false;
|
|
236
|
-
parentName = parent.$options.name;
|
|
237
|
-
}
|
|
238
|
-
return parent;
|
|
239
|
-
},
|
|
240
|
-
|
|
241
|
-
onEyes() {
|
|
242
|
-
this.showPassword = !this.showPassword
|
|
243
|
-
},
|
|
244
|
-
onInput(event) {
|
|
245
|
-
let value = event.detail.value;
|
|
246
|
-
// 判断是否去除空格
|
|
247
|
-
if (this.trim) {
|
|
248
|
-
if (typeof(this.trim) === 'boolean' && this.trim) {
|
|
249
|
-
value = this.trimStr(value)
|
|
250
|
-
}
|
|
251
|
-
if (typeof(this.trim) === 'string') {
|
|
252
|
-
value = this.trimStr(value, this.trim)
|
|
253
|
-
}
|
|
254
|
-
};
|
|
255
|
-
if (this.errMsg) this.errMsg = ''
|
|
256
|
-
this.val = value
|
|
257
|
-
// TODO 兼容 vue2
|
|
258
|
-
this.$emit('input', value);
|
|
259
|
-
// TODO 兼容 vue3
|
|
260
|
-
this.$emit('update:modelValue', value)
|
|
261
|
-
},
|
|
262
|
-
|
|
263
|
-
onFocus(event) {
|
|
264
|
-
// this.focused = true;
|
|
265
|
-
this.$emit('focus', event);
|
|
266
|
-
},
|
|
267
|
-
onBlur(event) {
|
|
268
|
-
let value = event.detail.value;
|
|
269
|
-
// setTimeout(() => {
|
|
270
|
-
// this.focused = false;
|
|
271
|
-
// }, 100);
|
|
272
|
-
this.$emit('blur', event);
|
|
273
|
-
},
|
|
274
|
-
onConfirm(e) {
|
|
275
|
-
this.$emit('confirm', e.detail.value);
|
|
276
|
-
},
|
|
277
|
-
onClear(event) {
|
|
278
|
-
this.val = '';
|
|
279
|
-
// TODO 兼容 vue2
|
|
280
|
-
this.$emit('input', '');
|
|
281
|
-
// TODO 兼容 vue2
|
|
282
|
-
// TODO 兼容 vue3
|
|
283
|
-
this.$emit('update:modelValue', '')
|
|
284
|
-
},
|
|
285
|
-
fieldClick() {
|
|
286
|
-
this.$emit('click');
|
|
287
|
-
},
|
|
288
|
-
trimStr(str, pos = 'both') {
|
|
289
|
-
if (pos === 'both') {
|
|
290
|
-
return str.trim();
|
|
291
|
-
} else if (pos === 'left') {
|
|
292
|
-
return str.trimLeft();
|
|
293
|
-
} else if (pos === 'right') {
|
|
294
|
-
return str.trimRight();
|
|
295
|
-
} else if (pos === 'start') {
|
|
296
|
-
return str.trimStart()
|
|
297
|
-
} else if (pos === 'end') {
|
|
298
|
-
return str.trimEnd()
|
|
299
|
-
} else if (pos === 'all') {
|
|
300
|
-
return str.replace(/\s+/g, '');
|
|
301
|
-
} else if (pos === 'none') {
|
|
302
|
-
return str;
|
|
303
|
-
}
|
|
304
|
-
return str;
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
};
|
|
308
|
-
</script>
|
|
309
|
-
|
|
310
|
-
<style scoped>
|
|
311
|
-
.uni-easyinput {
|
|
312
|
-
/* #ifndef APP-NVUE */
|
|
313
|
-
width: 100%;
|
|
314
|
-
/* #endif */
|
|
315
|
-
flex: 1;
|
|
316
|
-
position: relative;
|
|
317
|
-
text-align: left;
|
|
318
|
-
color: #333;
|
|
319
|
-
font-size: 14px;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
.uni-easyinput__content {
|
|
323
|
-
flex: 1;
|
|
324
|
-
/* #ifndef APP-NVUE */
|
|
325
|
-
width: 100%;
|
|
326
|
-
display: flex;
|
|
327
|
-
box-sizing: border-box;
|
|
328
|
-
min-height: 36px;
|
|
329
|
-
/* #endif */
|
|
330
|
-
flex-direction: row;
|
|
331
|
-
align-items: center;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
.uni-easyinput__content-input {
|
|
335
|
-
/* #ifndef APP-NVUE */
|
|
336
|
-
width: auto;
|
|
337
|
-
/* #endif */
|
|
338
|
-
position: relative;
|
|
339
|
-
overflow: hidden;
|
|
340
|
-
flex: 1;
|
|
341
|
-
line-height: 1;
|
|
342
|
-
font-size: 14px;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
.is-textarea {
|
|
346
|
-
align-items: flex-start;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
.is-textarea-icon {
|
|
350
|
-
margin-top: 5px;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
.uni-easyinput__content-textarea {
|
|
354
|
-
position: relative;
|
|
355
|
-
overflow: hidden;
|
|
356
|
-
flex: 1;
|
|
357
|
-
line-height: 1.5;
|
|
358
|
-
font-size: 14px;
|
|
359
|
-
padding-top: 6px;
|
|
360
|
-
padding-bottom: 10px;
|
|
361
|
-
height: 80px;
|
|
362
|
-
/* #ifndef APP-NVUE */
|
|
363
|
-
min-height: 80px;
|
|
364
|
-
width: auto;
|
|
365
|
-
/* #endif */
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
.input-padding {
|
|
369
|
-
padding-left: 10px;
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
.content-clear-icon {
|
|
373
|
-
padding: 0 5px;
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
.label-icon {
|
|
377
|
-
margin-right: 5px;
|
|
378
|
-
margin-top: -1px;
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
.is-input-border {
|
|
382
|
-
/* #ifndef APP-NVUE */
|
|
383
|
-
display: flex;
|
|
384
|
-
box-sizing: border-box;
|
|
385
|
-
/* #endif */
|
|
386
|
-
flex-direction: row;
|
|
387
|
-
align-items: center;
|
|
388
|
-
border: 1px solid #e5e5e5;
|
|
389
|
-
border-radius: 4px;
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
.is-required {
|
|
393
|
-
color: #dd524d;
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
.uni-error-message {
|
|
397
|
-
position: absolute;
|
|
398
|
-
bottom: -17px;
|
|
399
|
-
left: 0;
|
|
400
|
-
line-height: 12px;
|
|
401
|
-
color: #dd524d;
|
|
402
|
-
font-size: 12px;
|
|
403
|
-
text-align: left;
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
.uni-error-msg--boeder {
|
|
407
|
-
position: relative;
|
|
408
|
-
bottom: 0;
|
|
409
|
-
line-height: 22px;
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
.is-input-error-border {
|
|
413
|
-
border-color: #dd524d;
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
.uni-easyinput--border {
|
|
417
|
-
margin-bottom: 0;
|
|
418
|
-
padding: 10px 15px;
|
|
419
|
-
border-top: 1px #eee solid;
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
.uni-easyinput-error {
|
|
423
|
-
padding-bottom: 0;
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
.is-first-border {
|
|
427
|
-
/* #ifndef APP-NVUE */
|
|
428
|
-
border: none;
|
|
429
|
-
/* #endif */
|
|
430
|
-
/* #ifdef APP-NVUE */
|
|
431
|
-
border-width: 0;
|
|
432
|
-
/* #endif */
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
.is-disabled {
|
|
436
|
-
background-color: #eee;
|
|
437
|
-
}
|
|
438
|
-
</style>
|