mobile.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <el-form size="large" class="login-content-form">
  3. <el-form-item class="login-animation1">
  4. <el-input type="text" :placeholder="$t('message.mobile.placeholder1')" v-model="ruleForm.username" clearable autocomplete="off">
  5. <template #prefix>
  6. <i class="iconfont icon-dianhua el-input__icon"></i>
  7. </template>
  8. </el-input>
  9. </el-form-item>
  10. <el-form-item class="login-animation2">
  11. <el-col :span="15">
  12. <el-input type="text" maxlength="4" :placeholder="$t('message.mobile.placeholder2')" v-model="ruleForm.code" clearable autocomplete="off">
  13. <template #prefix>
  14. <el-icon class="el-input__icon"><ele-Position /></el-icon>
  15. </template>
  16. </el-input>
  17. </el-col>
  18. <el-col :span="1"></el-col>
  19. <el-col :span="8">
  20. <el-button class="login-content-code">{{ $t('message.mobile.codeText') }}</el-button>
  21. </el-col>
  22. </el-form-item>
  23. <el-form-item class="login-animation3">
  24. <el-button round type="primary" class="login-content-submit">
  25. <span>{{ $t('message.mobile.btnText') }}</span>
  26. </el-button>
  27. </el-form-item>
  28. <div class="font12 mt30 login-animation4 login-msg">{{ $t('message.mobile.msgText') }}</div>
  29. </el-form>
  30. </template>
  31. <script lang="ts">
  32. import { toRefs, reactive, defineComponent } from 'vue';
  33. // 定义接口来定义对象的类型
  34. interface LoginMobileState {
  35. username: any;
  36. code: string | number | undefined;
  37. }
  38. // 定义对象与类型
  39. const ruleForm: LoginMobileState = {
  40. username: '',
  41. code: '',
  42. };
  43. export default defineComponent({
  44. name: 'loginMobile',
  45. setup() {
  46. const state = reactive({ ruleForm });
  47. return {
  48. ...toRefs(state),
  49. };
  50. },
  51. });
  52. </script>
  53. <style scoped lang="scss">
  54. .login-content-form {
  55. margin-top: 20px;
  56. @for $i from 1 through 4 {
  57. .login-animation#{$i} {
  58. opacity: 0;
  59. animation-name: error-num;
  60. animation-duration: 0.5s;
  61. animation-fill-mode: forwards;
  62. animation-delay: calc($i/10) + s;
  63. }
  64. }
  65. .login-content-code {
  66. width: 100%;
  67. padding: 0;
  68. }
  69. .login-content-submit {
  70. width: 100%;
  71. letter-spacing: 2px;
  72. font-weight: 300;
  73. margin-top: 15px;
  74. }
  75. .login-msg {
  76. color: var(--el-text-color-placeholder);
  77. }
  78. }
  79. </style>