Commit bbb0705a authored by zhengke's avatar zhengke

修改

parent 5cab2d6c
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
maxlength: { maxlength: {
immediate: true, immediate: true,
handler: function(newV) { handler: function(newV) {
this.ranges = []; this.ranges = [];
for(let i=1;i<=newV;i++){ for(let i=1;i<=newV;i++){
this.ranges.push(Number(i)) this.ranges.push(Number(i))
} }
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
}, },
value: { value: {
immediate: true, immediate: true,
handler: function(newV) { handler: function(newV) {
if (newV !== this.inputValue) { if (newV !== this.inputValue) {
this.inputValue = newV this.inputValue = newV
this.toMakeAndCheck(newV) this.toMakeAndCheck(newV)
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
}, },
methods: { methods: {
getVal(e) { getVal(e) {
const val = e.detail.value const val = e.detail.value
this.inputValue = val this.inputValue = val
this.$emit('input', val) this.$emit('input', val)
this.toMakeAndCheck(val) this.toMakeAndCheck(val)
...@@ -85,7 +85,8 @@ ...@@ -85,7 +85,8 @@
toMakeAndCheck(val) { toMakeAndCheck(val) {
const arr = val.split('') const arr = val.split('')
this.codeIndex = arr.length + 1 this.codeIndex = arr.length + 1
this.codeArr = arr this.codeArr = arr
if (this.codeIndex > Number(this.maxlength)) { if (this.codeIndex > Number(this.maxlength)) {
this.$emit('finish', this.codeArr.join('')) this.$emit('finish', this.codeArr.join(''))
} }
...@@ -131,19 +132,35 @@ ...@@ -131,19 +132,35 @@
justify-content: center; justify-content: center;
flex-wrap: wrap; flex-wrap: wrap;
position: relative; position: relative;
width:100%;
overflow: hidden;
} }
.flex-box .hide-input { .flex-box .hide-input {
position: absolute; position: absolute;
top: 0; top: 0;
left: -100%; width: 100%;
height: 100%;
text-align: left;
z-index: 9;
opacity: 0;
color:transparent;
caret-color:transparent;
}
/* .flex-box .hide-input {
position: absolute;
top: 0;
width: 200%; width: 200%;
height: 100%; height: 100%;
text-align: left; text-align: left;
z-index: 9; z-index: 9;
opacity: 0; opacity: 0;
} left:-100%;
color:transparent;
padding-left: 30.6rpx;
letter-spacing: 50.4rpx!important;
caret-color: transparent!important;
} */
.flex-box .item { .flex-box .item {
position: relative; position: relative;
width: 80upx; width: 80upx;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment