sadais-piui 1.2.5 → 1.2.6-beta1
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/components/pi-input/index.vue +20 -1
- package/config/input.js +1 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view class="pi-input-wrap">
|
|
2
|
+
<view class="pi-input-wrap" :style="[getInputWrapStyle]">
|
|
3
3
|
<textarea
|
|
4
4
|
v-if="type === 'textarea'"
|
|
5
5
|
class="pi-input-textarea"
|
|
@@ -145,6 +145,12 @@ export default {
|
|
|
145
145
|
// false
|
|
146
146
|
default: input.disabled
|
|
147
147
|
},
|
|
148
|
+
// 边框样式设置
|
|
149
|
+
border: {
|
|
150
|
+
type: [Boolean, String],
|
|
151
|
+
// false
|
|
152
|
+
default: input.border
|
|
153
|
+
},
|
|
148
154
|
// 最大输入长度,设置为 -1 的时候不限制最大长度
|
|
149
155
|
maxlength: {
|
|
150
156
|
type: [Number, String],
|
|
@@ -247,6 +253,19 @@ export default {
|
|
|
247
253
|
const parentFormItem = this.$pi.parent(this, 'PiFormItem')
|
|
248
254
|
const disabled = this.disabled || (parentFormItem && parentFormItem.getDisabled)
|
|
249
255
|
return disabled
|
|
256
|
+
},
|
|
257
|
+
getInputWrapStyle() {
|
|
258
|
+
const style = {}
|
|
259
|
+
if (this.border) {
|
|
260
|
+
style.padding = '8rpx 14rpx'
|
|
261
|
+
style.borderRadius = '4rpx'
|
|
262
|
+
if (this.$pi.lang.isString(this.border)) {
|
|
263
|
+
style.border = this.border
|
|
264
|
+
} else {
|
|
265
|
+
style.border = '1Px solid #d9d9d9'
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
return style
|
|
250
269
|
}
|
|
251
270
|
},
|
|
252
271
|
methods: {
|
package/config/input.js
CHANGED
|
@@ -6,6 +6,7 @@ export default {
|
|
|
6
6
|
placeholderStyle: 'color: #c0c4cc; font-weight: 400;', // 指定 placeholder 的样式
|
|
7
7
|
placeholderClass: 'input-placeholder', // 指定 placeholder 的样式类,注意页面或组件的style中写了scoped时,需要在类名前写::v-deep
|
|
8
8
|
disabled: false, // 是否禁用
|
|
9
|
+
border: false, // 边框样式设置
|
|
9
10
|
maxlength: 140, // 最大输入长度,设置为 -1 的时候不限制最大长度
|
|
10
11
|
password: false,
|
|
11
12
|
cursorSpacing: 0, // 指定光标与键盘的距离,单位 px
|