提交 85f63720 编写于 作者: X xiaoyucoding

fix: 修复多个 input 时只有第一个 input 正确计算高度的问题

上级 942d74bf
...@@ -34,7 +34,6 @@ import { ...@@ -34,7 +34,6 @@ import {
} from 'uni-mixins' } from 'uni-mixins'
const INPUT_TYPES = ['text', 'number', 'idcard', 'digit', 'password'] const INPUT_TYPES = ['text', 'number', 'idcard', 'digit', 'password']
const NUMBER_TYPES = ['number', 'digit'] const NUMBER_TYPES = ['number', 'digit']
let isRendered = false
export default { export default {
name: 'Input', name: 'Input',
mixins: [emitter], mixins: [emitter],
...@@ -93,7 +92,8 @@ export default { ...@@ -93,7 +92,8 @@ export default {
inputValue: this.value + '', inputValue: this.value + '',
composing: false, composing: false,
wrapperHeight: 0, wrapperHeight: 0,
cachedValue: '' cachedValue: '',
isRendered: false
} }
}, },
computed: { computed: {
...@@ -165,7 +165,7 @@ export default { ...@@ -165,7 +165,7 @@ export default {
}, },
methods: { methods: {
_resize () { _resize () {
if (!isRendered) { if (!this.isRendered) {
this._initInputStyle() this._initInputStyle()
} }
}, },
...@@ -180,7 +180,7 @@ export default { ...@@ -180,7 +180,7 @@ export default {
if (!rectStyle.height) { if (!rectStyle.height) {
return return
} else { } else {
isRendered = true this.isRendered = true
} }
// 渲染之后进行计算,设置实际的高度等样式。 // 渲染之后进行计算,设置实际的高度等样式。
const realHeight = rectStyle.height - (parseFloat(computedStyle.borderTopWidth, 10) + parseFloat(computedStyle.borderBottomWidth, const realHeight = rectStyle.height - (parseFloat(computedStyle.borderTopWidth, 10) + parseFloat(computedStyle.borderBottomWidth,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册