vant-fork
Version:
Lightweight Mobile UI Components built on Vue
59 lines (53 loc) • 1.28 kB
JavaScript
import create from '../utils/create';
export default create({
render: function render() {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
return _c('div', {
class: _vm.b()
}, [_c('ul', {
staticClass: "van-hairline--surround",
class: _vm.b('security'),
on: {
"touchstart": function touchstart($event) {
$event.stopPropagation();
_vm.$emit('focus');
}
}
}, _vm._l(_vm.points, function (visibility) {
return _c('li', {
staticClass: "van-hairline"
}, [_c('i', {
style: "visibility: " + visibility
})]);
})), _vm.errorInfo || _vm.info ? _c('div', {
class: _vm.b(_vm.errorInfo ? 'error-info' : 'info'),
domProps: {
"textContent": _vm._s(_vm.errorInfo || _vm.info)
}
}) : _vm._e()]);
},
name: 'password-input',
props: {
info: String,
errorInfo: String,
value: {
type: String,
default: ''
},
length: {
type: Number,
default: 6
}
},
computed: {
points: function points() {
var arr = [];
for (var i = 0; i < this.length; i++) {
arr[i] = this.value[i] ? 'visible' : 'hidden';
}
return arr;
}
}
});