Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
teddi
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
wildfirecode13
teddi
Commits
fc4f6656
Commit
fc4f6656
authored
Dec 09, 2020
by
wildfirecode13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
883e62bd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
app.less
examples/src/app.less
+1
-1
pageindex.jsx
examples/src/pages/pageindex/pageindex.jsx
+12
-4
No files found.
examples/src/app.less
View file @
fc4f6656
...
...
@@ -4,7 +4,7 @@
}
html,
body {
font-size:
24
px;
font-size:
12
px;
width: 100%;
height: 100%;
}
examples/src/pages/pageindex/pageindex.jsx
View file @
fc4f6656
...
...
@@ -10,21 +10,29 @@ import { Countdown } from 'teddi'
class
Pageindex
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
resList
:
resList
};
this
.
state
=
{
resList
:
resList
,
countdown1
:{},
countdown2
:{}
};
}
componentDidMount
()
{
const
countdown
=
new
Countdown
(
86400
*
2
+
3600
*
1
+
60
*
1
+
1
,
'ddhhmmss'
);
countdown
.
on
(
'update'
,
(
data
)
=>
{
const
{
dd
,
hh
,
mm
,
ss
}
=
data
;
console
.
log
(
data
)
this
.
setState
({
countdown1
:
data
})
},
this
);
countdown
.
start
();
const
countdown2
=
new
Countdown
(
3600
*
1
+
60
*
1
+
1
,
'hhmmss'
);
countdown2
.
on
(
'update'
,
(
data
)
=>
{
this
.
setState
({
countdown2
:
data
})
},
this
);
countdown2
.
start
();
}
render
()
{
const
{
countdown1
,
countdown2
}
=
this
.
state
;
return
<
div
className=
"index "
>
<
div
>
</
div
>
<
div
>
{
countdown1
.
dd
}
:
{
countdown1
.
hh
}
:
{
countdown1
.
mm
}
:
{
countdown1
.
ss
}
</
div
>
<
div
>
{
countdown1
.
dd
}
天
{
countdown1
.
hh
}
小时
{
countdown1
.
mm
}
分钟
{
countdown1
.
ss
}
秒
</
div
>
<
div
>
{
countdown2
.
hh
}
小时
{
countdown2
.
mm
}
分钟
{
countdown2
.
ss
}
秒
</
div
>
</
div
>;
}
}
...
...
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