index.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. "use strict";
  2. var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
  3. exports.__esModule = true;
  4. exports["default"] = void 0;
  5. var _babelHelperVueJsxMergeProps = _interopRequireDefault(require("@vue/babel-helper-vue-jsx-merge-props"));
  6. var _utils = require("../utils");
  7. var _functional = require("../utils/functional");
  8. var _use = (0, _utils.use)('password-input'),
  9. sfc = _use[0],
  10. bem = _use[1];
  11. function PasswordInput(h, props, slots, ctx) {
  12. var info = props.errorInfo || props.info;
  13. var Points = [];
  14. for (var i = 0; i < props.length; i++) {
  15. var _char = props.value[i];
  16. Points.push(h("li", {
  17. "class": "van-hairline"
  18. }, [props.mask ? h("i", {
  19. "style": {
  20. visibility: _char ? 'visible' : 'hidden'
  21. }
  22. }) : _char]));
  23. }
  24. return h("div", {
  25. "class": bem()
  26. }, [h("ul", (0, _babelHelperVueJsxMergeProps["default"])([{
  27. "class": [bem('security'), 'van-hairline--surround'],
  28. "on": {
  29. "touchstart": function touchstart(event) {
  30. event.stopPropagation();
  31. (0, _functional.emit)(ctx, 'focus', event);
  32. }
  33. }
  34. }, (0, _functional.inherit)(ctx, true)]), [Points]), info && h("div", {
  35. "class": bem(props.errorInfo ? 'error-info' : 'info')
  36. }, [info])]);
  37. }
  38. PasswordInput.props = {
  39. info: String,
  40. errorInfo: String,
  41. mask: {
  42. type: Boolean,
  43. "default": true
  44. },
  45. value: {
  46. type: String,
  47. "default": ''
  48. },
  49. length: {
  50. type: Number,
  51. "default": 6
  52. }
  53. };
  54. var _default = sfc(PasswordInput);
  55. exports["default"] = _default;