-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
141 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,8 @@ | ||
import router from './router' | ||
import NProgress from 'nprogress' | ||
import settings from './settings' | ||
router.beforeEach(async (to, from, next) => { | ||
if (settings.isNeedNprogress) NProgress.start() | ||
|
||
//jump page | ||
next() | ||
}) | ||
|
||
router.afterEach(() => { | ||
if (settings.isNeedNprogress) NProgress.done() | ||
}) | ||
router.afterEach(() => {}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,74 @@ | ||
<template> | ||
<div class="mbPx-4">req relative</div> | ||
<van-button type="primary" size="small" @click="testReq">test Req</van-button> | ||
<div class="mbPx-4 mt-4">基础用法</div> | ||
<van-count-down :time="time" /> | ||
|
||
<div class="mbPx-4 mt-4">mock demo</div> | ||
<van-button type="primary" size="small" @click="mockRelative">mockRelative</van-button> | ||
<div class="mbPx-4 mt-4">自定义格式</div> | ||
<van-count-down :time="time" format="DD 天 HH 时 mm 分 ss 秒" /> | ||
|
||
<div class="mbPx-4 mt-4">VuexUse</div> | ||
<van-button type="primary" size="small" @click="VuexUse">VuexUse</van-button> | ||
<div class="mbPx-4 mt-4">毫秒级渲染</div> | ||
<van-count-down millisecond :time="time" format="HH:mm:ss:SS" /> | ||
|
||
<div class="mbPx-4 mt-4">SvgIcon</div> | ||
<van-button type="primary" size="small" @click="SvgIcon">SvgIcon</van-button> | ||
<div class="mbPx-4 mt-4">自定义样式</div> | ||
<van-count-down :time="time"> | ||
<template #default="timeData"> | ||
<span class="block">{{ timeData.hours }}</span> | ||
<span class="colon">:</span> | ||
<span class="block">{{ timeData.minutes }}</span> | ||
<span class="colon">:</span> | ||
<span class="block">{{ timeData.seconds }}</span> | ||
</template> | ||
</van-count-down> | ||
|
||
<div class="mbPx-4 mt-4">KeepAlive</div> | ||
<van-button type="primary" size="small" @click="KeepAlive">KeepAlive</van-button> | ||
<div class="mbPx-4 mt-4">手动控制</div> | ||
<van-count-down ref="countDown" millisecond :time="3000" :auto-start="false" format="ss:SSS" @finish="onFinish" /> | ||
<van-grid clickable> | ||
<van-grid-item text="开始" icon="play-circle-o" @click="start" /> | ||
<van-grid-item text="暂停" icon="pause-circle-o" @click="pause" /> | ||
<van-grid-item text="重置" icon="replay" @click="reset" /> | ||
</van-grid> | ||
|
||
<div class="mb-2 mt-5">to look the use demo</div> | ||
<van-button type="primary" size="small" @click="ToExample">ToExample</van-button> | ||
</template> | ||
|
||
<script setup> | ||
import { onMounted, watch, ref, toRefs, reactive, computed } from 'vue' | ||
import axiosReq from '@/utils/axiosReq' | ||
import useVant from '@/hooks/useVant' | ||
import useRouter from '@/hooks/useRouter' | ||
const time = ref(30 * 60 * 60 * 1000) | ||
const testReq = () => { | ||
let reqConfig = { | ||
url: '/ty-user/user/loginOut', | ||
method: 'post', | ||
bfLoading: false, | ||
isAlertErrorMsg: false | ||
} | ||
axiosReq(reqConfig).then((res) => { | ||
useVant.vantToastNoneMixin('req success') | ||
}) | ||
} | ||
const countDown = ref(null) | ||
//mock | ||
const mockRelative = () => { | ||
useRouter.routerPushMixin('MockTest') | ||
const start = () => { | ||
countDown.value.start() | ||
} | ||
//VuexUse | ||
const VuexUse = () => { | ||
useRouter.routerPushMixin('VuexUse') | ||
const pause = () => { | ||
countDown.value.pause() | ||
} | ||
//SvgIcon | ||
const SvgIcon = () => { | ||
useRouter.routerPushMixin('SvgIcon') | ||
const reset = () => { | ||
countDown.value.reset() | ||
} | ||
import { Toast } from 'vant' | ||
const onFinish = () => Toast('倒计时结束') | ||
import useRouter from '@/hooks/useRouter' | ||
//KeepAlive | ||
const KeepAlive = () => { | ||
useRouter.routerPushMixin('KeepAlive') | ||
//ToExample | ||
const ToExample = () => { | ||
useRouter.routerPushMixin('Example') | ||
} | ||
</script> | ||
|
||
<style scoped lang="scss"></style> | ||
<style> | ||
.colon { | ||
display: inline-block; | ||
margin: 0 8px; | ||
color: #ee0a24; | ||
} | ||
.block { | ||
display: inline-block; | ||
width: 44px; | ||
color: #fff; | ||
font-size: 28px; | ||
text-align: center; | ||
background-color: #ee0a24; | ||
} | ||
</style> |
Oops, something went wrong.