| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- <template>
- <router-view />
- </template>
- <script lang="ts" setup>
- import { useRouter } from 'vue-router'
- import { closeToast, showLoadingToast } from 'vant'
- const router = useRouter()
- // 在路由跳转前启动加载动画
- router.beforeEach((to, from, next) => {
- showLoadingToast({
- duration: 0,
- forbidClick: true,
- message: '加载中...',
- });
- next()
- })
- // 在路由跳转后隐藏加载动画
- router.afterEach(() => {
- closeToast();
- })
- </script>
- <style >
- .flex {
- display: flex;
- }
- .flexColumn {
- flex-direction: column;
- }
- .center {
- align-items: center;
- justify-content: center;
- }
- .alignCenter {
- align-items: center;
- }
- .alignStart {
- align-items: flex-start;
- }
- .alignEnd {
- align-items: flex-end;
- }
- .spaceBetween {
- justify-content: space-between;
- }
- .spaceEvenly {
- justify-content: space-evenly;
- }
- .spaceAround {
- justify-content: space-around;
- }
- .spaceCenter {
- justify-content: center;
- }
- .justifyEnd {
- justify-content: flex-end;
- }
- .allFlex {
- flex: 1;
- }
- .flexWrap {
- flex-wrap: wrap;
- }
- .flexNoWrap {
- flex-wrap: nowrap;
- }
- .width1 {
- width: 10%;
- }
- .width2 {
- width: 20%;
- }
- .width3 {
- width: 30%;
- }
- .width4 {
- width: 40%;
- }
- .width5 {
- width: 50%;
- }
- .width6 {
- width: 60%;
- }
- .width7 {
- width: 70%;
- }
- .width8 {
- width: 80%;
- }
- .width9 {
- width: 90%;
- }
- .width10 {
- width: 100%;
- }
- </style>
|