sadais-piui 1.2.7-beta72 → 1.2.7-beta73
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 +13 -21
- package/config/input.js +0 -1
- package/package.json +1 -1
|
@@ -5,16 +5,11 @@
|
|
|
5
5
|
:class="[{ disabled: getDisabled }]"
|
|
6
6
|
@tap="handleItemClick"
|
|
7
7
|
>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
:style="[customStyle, readonlyStyle]"
|
|
12
|
-
:class="[customClass, readonlyClass]"
|
|
13
|
-
>
|
|
14
|
-
{{ val || placeholder }}
|
|
15
|
-
</view>
|
|
8
|
+
<!-- 当disabled,增加一个abso的蒙层,为了触发click事件 -->
|
|
9
|
+
<view v-if="getDisabled" class="pi-input-mask pi-abso-full" />
|
|
10
|
+
|
|
16
11
|
<textarea
|
|
17
|
-
v-
|
|
12
|
+
v-if="type === 'textarea'"
|
|
18
13
|
class="pi-input-textarea"
|
|
19
14
|
:style="[customStyle]"
|
|
20
15
|
:class="[customClass]"
|
|
@@ -23,10 +18,10 @@
|
|
|
23
18
|
:placeholder="placeholder"
|
|
24
19
|
:placeholder-style="placeholderStyle"
|
|
25
20
|
:placeholder-class="placeholderClass"
|
|
26
|
-
:readonly="getDisabled"
|
|
27
21
|
:maxlength="maxlength"
|
|
28
22
|
:cursor-spacing="cursorSpacing"
|
|
29
23
|
:focus="focus"
|
|
24
|
+
:disabled="getDisabled"
|
|
30
25
|
:confirm-hold="confirmHold"
|
|
31
26
|
:cursor="cursor"
|
|
32
27
|
:selection-start="selectionStart"
|
|
@@ -55,10 +50,10 @@
|
|
|
55
50
|
:placeholder="placeholder"
|
|
56
51
|
:placeholder-style="placeholderStyle"
|
|
57
52
|
:placeholder-class="placeholderClass"
|
|
58
|
-
:readonly="getDisabled"
|
|
59
53
|
:maxlength="maxlength"
|
|
60
54
|
:cursor-spacing="cursorSpacing"
|
|
61
55
|
:focus="focus"
|
|
56
|
+
:disabled="getDisabled"
|
|
62
57
|
:confirm-hold="confirmHold"
|
|
63
58
|
:cursor="cursor"
|
|
64
59
|
:selection-start="selectionStart"
|
|
@@ -277,10 +272,6 @@ export default {
|
|
|
277
272
|
default() {
|
|
278
273
|
return input.clearIcon
|
|
279
274
|
}
|
|
280
|
-
},
|
|
281
|
-
readonly: {
|
|
282
|
-
type: Boolean,
|
|
283
|
-
default: input.readonly || false
|
|
284
275
|
}
|
|
285
276
|
},
|
|
286
277
|
data() {
|
|
@@ -289,12 +280,6 @@ export default {
|
|
|
289
280
|
}
|
|
290
281
|
},
|
|
291
282
|
computed: {
|
|
292
|
-
readonlyClass() {
|
|
293
|
-
return this.val ? '' : this.placeholderClass
|
|
294
|
-
},
|
|
295
|
-
readonlyStyle() {
|
|
296
|
-
return this.val ? '' : this.placeholderStyle
|
|
297
|
-
},
|
|
298
283
|
getDisabled() {
|
|
299
284
|
const parentFormItem = this.$pi.parent(this, 'PiFormItem')
|
|
300
285
|
const disabled = this.disabled || (parentFormItem && parentFormItem.getDisabled)
|
|
@@ -316,6 +301,7 @@ export default {
|
|
|
316
301
|
},
|
|
317
302
|
methods: {
|
|
318
303
|
handleItemClick(e) {
|
|
304
|
+
console.log(123)
|
|
319
305
|
this.$emit('click', e)
|
|
320
306
|
},
|
|
321
307
|
handleInput: debounce(function(e) {
|
|
@@ -358,6 +344,7 @@ export default {
|
|
|
358
344
|
|
|
359
345
|
<style lang="scss" scoped>
|
|
360
346
|
.pi-input-wrap {
|
|
347
|
+
position: relative;
|
|
361
348
|
width: 100%;
|
|
362
349
|
display: flex;
|
|
363
350
|
align-items: center;
|
|
@@ -365,5 +352,10 @@ export default {
|
|
|
365
352
|
.pi-input-textarea {
|
|
366
353
|
width: 100%;
|
|
367
354
|
}
|
|
355
|
+
|
|
356
|
+
.pi-input-mask {
|
|
357
|
+
background: transparent;
|
|
358
|
+
z-index: 101;
|
|
359
|
+
}
|
|
368
360
|
}
|
|
369
361
|
</style>
|
package/config/input.js
CHANGED