App.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <div id="app" v-loading="defaultLoading">
  3. <!-- <transition name="fade" mode="out-in"> -->
  4. <router-view />
  5. <!-- </transition> -->
  6. </div>
  7. </template>
  8. <script>
  9. import { login } from "@/api/login";
  10. import { testApi } from "@/api/test";
  11. // import "@/assets/style/index.css";
  12. export default {
  13. created() {},
  14. computed: {
  15. defaultLoading() {
  16. return this.$store.state.settings.loading;
  17. },
  18. },
  19. methods: {
  20. // 调取后端api方法
  21. addLog() {
  22. const data = {
  23. userName: "测试1",
  24. password: "1111",
  25. };
  26. login(data).then((res) => {});
  27. },
  28. // 调取后端api方法
  29. test(id) {
  30. const data = {
  31. userName: "测试2",
  32. password: "1111",
  33. };
  34. testApi(data, id).then((res) => {
  35. console.log(res);
  36. });
  37. },
  38. },
  39. };
  40. </script>
  41. <style lang="scss">
  42. body {
  43. width: 100%;
  44. height: 100%;
  45. }
  46. .fade-enter-active,
  47. .fade-leave-active {
  48. transition: opacity 0.5s ease;
  49. }
  50. .fade-enter, .fade-leave-to /* .fade-leave-active in <2.1.8 */ {
  51. opacity: 0;
  52. }
  53. </style>
  54. <style scoped>
  55. #app .theme-picker {
  56. display: none;
  57. }
  58. </style>
  59. <style>
  60. ::v-deep .el-color-dropdown .el-color-dropdown__main-wrapper {
  61. display: none !important;
  62. }
  63. .el-color-svpanel {
  64. display: none !important;
  65. }
  66. .el-color-hue-slider {
  67. display: none !important;
  68. }
  69. </style>