您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

password-input.vue 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <template>
  2. <view class="psdIptBx">
  3. <block v-for="(item , index) in psdIptNum" :key='index'>
  4. <view class="psdTtem">
  5. <text v-if="numLng.length > index" class="psdTtemTxt">
  6. <text v-if="plaintext">●</text>
  7. <text v-else>{{numLng[index]}}</text>
  8. </text>
  9. <text v-if="numLng.length ==index" class="focus_move">|</text>
  10. </view>
  11. </block>
  12. </view>
  13. </template>
  14. <script>
  15. export default {
  16. props: {
  17. //是否明文 默认密文
  18. plaintext: {
  19. type: Boolean,
  20. default: true
  21. },
  22. //键盘输入的val
  23. numLng: {
  24. type: [String, Number],
  25. default: ''
  26. },
  27. //密码框的个数
  28. psdIptNum: {
  29. type: [String, Number],
  30. default: 6
  31. }
  32. },
  33. data() {
  34. return {}
  35. },
  36. created() {},
  37. methods: {
  38. }
  39. }
  40. </script>
  41. <style scoped>
  42. .psdIptBx {
  43. display: flex;
  44. width: 100%;
  45. text-align: center;
  46. border-bottom: 1px solid #ccc;
  47. border-top: 1px solid #ccc;
  48. border-right: 1px solid #ccc;
  49. }
  50. .psdTtem {
  51. flex: 1;
  52. height: 80rpx;
  53. border-left: 1px solid #ccc;
  54. line-height: 1;
  55. }
  56. .psdTtemTxt {
  57. text-align: center;
  58. line-height: 80rpx;
  59. font-size: 30rpx;
  60. }
  61. .focus_move {
  62. color: #E6240F;
  63. font-size: 30rpx;
  64. line-height: 80rpx;
  65. animation: focus 0.8s infinite;
  66. }
  67. @keyframes focus {
  68. from {
  69. opacity: 1;
  70. }
  71. to {
  72. opacity: 0;
  73. }
  74. }
  75. </style>