captain-ui
Version:
有赞vue wap业务组件库
88 lines (85 loc) • 2 kB
JavaScript
import InputMixin from '../../../common/mixins/input-mixin';
export default {
render: function render() {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
return _c('div', {
directives: [{
name: "clickoutside",
rawName: "v-clickoutside",
value: _vm.doCloseFocus,
expression: "doCloseFocus"
}],
staticClass: "cap-login__password"
}, [_vm.passwordShow ? [_c('input', {
attrs: {
"type": "text",
"placeholder": _vm.placeholder
},
domProps: {
"value": _vm.currentValue
},
on: {
"focus": function focus($event) {
_vm.isFocus = true;
},
"input": _vm.handleInput
}
}), _c('van-icon', {
directives: [{
name: "show",
rawName: "v-show",
value: _vm.isFocus && _vm.currentValue,
expression: "isFocus && currentValue"
}],
attrs: {
"name": "password-view"
},
on: {
"click": function click($event) {
_vm.passwordShow = !_vm.passwordShow;
}
}
})] : [_c('input', {
attrs: {
"type": "password",
"placeholder": _vm.placeholder
},
domProps: {
"value": _vm.currentValue
},
on: {
"focus": function focus($event) {
_vm.isFocus = true;
},
"input": _vm.handleInput
}
}), _c('van-icon', {
directives: [{
name: "show",
rawName: "v-show",
value: _vm.isFocus && _vm.currentValue,
expression: "isFocus && currentValue"
}],
attrs: {
"name": "password-not-view"
},
on: {
"click": function click($event) {
_vm.passwordShow = !_vm.passwordShow;
}
}
})]], 2);
},
mixins: [InputMixin],
props: {
value: String,
placeholder: String
},
data: function data() {
return {
passwordShow: false
};
}
};