passwordSettings.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <div class="password-settings">
  3. <span class="title">设置访问密码</span>
  4. <br>
  5. <div class="input-wrapper">
  6. <input
  7. :type="canSee ? 'text' : 'password'"
  8. placeholder="请输入访问密码,限20位"
  9. :maxlength="20"
  10. oninput="value=value.replace(/\s+/g,'')"
  11. v-model="info.password"
  12. >
  13. <i class="iconfont" @click="canSee = !canSee" :class="canSee ? ' icon-editor_on' : 'icon-editor_off'"></i>
  14. </div>
  15. </div>
  16. </template>
  17. <script>
  18. import { mapGetters } from "vuex";
  19. export default {
  20. components: {
  21. },
  22. data() {
  23. return {
  24. password:'',
  25. canSee: false,
  26. }
  27. },
  28. computed: {
  29. ...mapGetters({
  30. info:'info'
  31. })
  32. },
  33. methods: {
  34. }
  35. }
  36. </script>
  37. <style lang="less" scoped>
  38. .password-settings {
  39. padding: 24px 30px;
  40. background: #252526;
  41. height: 546px;
  42. .title {
  43. font-size: 18px;
  44. color: #FFFFFF;
  45. }
  46. > .input-wrapper {
  47. margin-top: 16px;
  48. position: relative;
  49. border: 1px solid #404040;
  50. padding: 0 16px;
  51. background: #1A1B1D;
  52. border-radius: 2px;
  53. height: 36px;
  54. width: 500px;
  55. &:focus-within {
  56. border-color: #0076F6;
  57. }
  58. > input {
  59. border: none;
  60. background: transparent;
  61. outline: none;
  62. height: 100%;
  63. width: calc(100% - 22px);
  64. padding: 0;
  65. color: #fff;
  66. letter-spacing: 1px;
  67. font-size: 14px;
  68. background: redv;
  69. }
  70. > i {
  71. padding: 5px;
  72. position: absolute;
  73. top: 50%;
  74. transform: translateY(-50%);
  75. right: 11px;
  76. font-size: 14px;
  77. color: rgba(255, 255, 255);
  78. }
  79. }
  80. }
  81. </style>