石墨仪设备 前端仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.3 KiB

  1. <template>
  2. <div class="w-[440px] bg-white px-5 py-[30px] rounded-lg text-text">
  3. <p class="text-xl font-medium">修改密码</p>
  4. <section class="update_pwd_main">
  5. <div class="text-xl flex items-center h-16">
  6. <div class="min-w-[100px] text-right">新密码</div>
  7. <el-input type="password" placeholder="新密码" v-model="new_pwd" style="width: 200px" class="ml-5" />
  8. </div>
  9. <div class="text-xl flex items-center h-16">
  10. <div class="min-w-[100px] text-right">确认密码</div>
  11. <el-input type="password" placeholder="确认新密码" v-model="confirm_pwd" style="width: 200px" class="ml-5" />
  12. </div>
  13. </section>
  14. <footer class="mt-4 flex justify-center items-center text-sm font-medium gap-x-8">
  15. <button class="btn-dark px-10 py-2 text-xl" @click="onSubmit">确认</button>
  16. <button class="btn-light px-10 py-2 text-xl" @click="onCancel">取消</button>
  17. </footer>
  18. </div>
  19. </template>
  20. <script lang="ts" setup>
  21. import { ElMessage } from "element-plus";
  22. import { ref } from "vue";
  23. const new_pwd = ref("");
  24. const confirm_pwd = ref("");
  25. const emits = defineEmits(["confirm", "cancel"]);
  26. const onSubmit = () => {
  27. if (new_pwd.value !== confirm_pwd.value) {
  28. ElMessage.warning("两次密码不一致");
  29. return;
  30. } else {
  31. emits("confirm", new_pwd.value);
  32. }
  33. };
  34. const onCancel = () => {
  35. emits("cancel");
  36. };
  37. </script>