Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
shld-databoard-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
潘自豪 Rambo Pan
shld-databoard-ui
Commits
fbcf17e2
Commit
fbcf17e2
authored
Sep 14, 2023
by
张恒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加倒计时器,10s刷新页面
parent
d6e7fc58
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
2 deletions
+31
-2
index.vue
src/module/index/index.vue
+31
-2
No files found.
src/module/index/index.vue
View file @
fbcf17e2
...
...
@@ -7,10 +7,10 @@
<span>
星期三
</span>
</div>
<div
class=
"text_right"
>
<span>
刷新时间:
10
s
</span>
<span>
刷新时间:
{{
countDown
}}
s
</span>
</div>
</div>
<router-view
style=
"height: 90%"
></router-view>
<router-view
style=
"height: 90%"
v-if=
"isRouterAlive"
></router-view>
</div>
</
template
>
...
...
@@ -21,9 +21,38 @@ window.$ = window.jQuery = require('materialize-css/node_modules/jquery/dist/jqu
require
(
'materialize-css'
)
export
default
{
name
:
'app'
,
data
()
{
return
{
countDown
:
10
,
isRouterAlive
:
true
,
countDownTimer
:
null
,
}
},
methods
:
{
goIndex
()
{
this
.
$router
.
push
({
path
:
'/'
})
},
reload
()
{
this
.
isRouterAlive
=
false
this
.
$nextTick
(
function
()
{
this
.
isRouterAlive
=
true
})
}
},
mounted
()
{
// 倒计时器
this
.
countDownTimer
=
setInterval
(()
=>
{
this
.
countDown
--
if
(
this
.
countDown
<=
0
)
{
this
.
reload
()
this
.
countDown
=
10
}
},
1000
)
},
beforeDestroy
()
{
// 倒计时器
if
(
this
.
countDownTimer
)
{
clearInterval
(
this
.
countDownTimer
)
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment