Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
study
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
Damon
study
Commits
f4c05ea9
Commit
f4c05ea9
authored
Jul 08, 2021
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 科目统计组件
parent
7059c899
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
166 additions
and
2 deletions
+166
-2
index.vue
src/components/answer-explanation/index.vue
+1
-1
index.vue
src/components/answer-sheet/index.vue
+1
-1
index.vue
src/components/subject-statistics/index.vue
+98
-0
readme.md
src/components/subject-statistics/readme.md
+66
-0
No files found.
src/components/answer-explanation/index.vue
View file @
f4c05ea9
...
@@ -38,7 +38,7 @@ export default {
...
@@ -38,7 +38,7 @@ export default {
}
}
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
>
<
style
lang=
"scss"
scoped
>
.card
{
.card
{
.content
{
.content
{
flex-flow
:
column
;
flex-flow
:
column
;
...
...
src/components/answer-sheet/index.vue
View file @
f4c05ea9
...
@@ -53,7 +53,7 @@ export default {
...
@@ -53,7 +53,7 @@ export default {
},
},
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
>
<
style
lang=
"scss"
scoped
>
.sheet
{
.sheet
{
flex-flow
:
column
;
flex-flow
:
column
;
.lists
{
.lists
{
...
...
src/components/subject-statistics/index.vue
0 → 100644
View file @
f4c05ea9
<
template
>
<view
class=
"u-flex statis"
>
<view
class=
"u-flex top"
>
<view
class=
"u-flex days"
>
<view>
<u-count-to
:start-val=
"0"
:end-val=
"days"
></u-count-to>
</view>
<view>
累计坚持天数
</view>
</view>
<view
class=
"u-flex topics"
>
<view
class=
"topics-lists"
>
今日做题:
<u-count-to
:start-val=
"0"
:end-val=
"today"
:font-size=
"30"
color=
"#000"
></u-count-to>
</view>
<view
class=
"topics-lists"
>
累计做题:
<u-count-to
:start-val=
"0"
:end-val=
"total"
:font-size=
"30"
color=
"#000"
></u-count-to>
</view>
</view>
</view>
<view
class=
"center"
>
<u-button
type=
"primary"
@
click=
"answer"
>
每日一练
</u-button>
</view>
<view
class=
"bottom"
>
<u-notice-bar
mode=
"vertical"
type=
"none"
:list=
"dynamic"
></u-notice-bar>
</view>
</view>
</
template
>
<
script
>
export
default
{
name
:
'subjectStatistics'
,
props
:
{
days
:
{
type
:
Number
,
default
:
0
,
},
today
:
{
type
:
Number
,
default
:
0
,
},
total
:
{
type
:
Number
,
default
:
0
,
},
dynamic
:
{
type
:
Array
,
default
:
[],
},
},
data
()
{
return
{
lists
:
[],
}
},
created
()
{},
methods
:
{
answer
()
{
this
.
$emit
(
'answer'
)
},
},
}
</
script
>
<
style
lang=
"scss"
scoped
>
.statis
{
flex-flow
:
column
;
width
:
100%
;
background
:
#fbfbfb
;
padding
:
10rpx
;
.top
{
width
:
100%
;
justify-content
:
space-around
;
padding-top
:
20rpx
;
.days
{
flex-flow
:
column
;
flex
:
1
;
border-right
:
2rpx
solid
#ccc
;
}
.topics
{
flex-flow
:
column
;
flex
:
1
;
padding-left
:
50rpx
;
.topics-lists
{
width
:
100%
;
padding
:
10rpx
0rpx
;
}
}
}
.center
{
width
:
100%
;
padding
:
30rpx
30rpx
0
30rpx
;
}
.bottom
{
width
:
100%
;
padding
:
10rpx
;
}
}
</
style
>
src/components/subject-statistics/readme.md
0 → 100644
View file @
f4c05ea9
## 科目统计
```
科目统计组件,用于首页统计模块。
```
## API
### Props
| 属性名 | 类型 | 默认值 | 可选值 | 说明 |
| :-----: | :----: | :----: | :----: | :-------------------------: |
| days | Number | 0 | - | 累计坚持天数 |
| today | Number | 0 | - | 今日做题 |
| total | Number | 0 | - | 累计做题 |
| dynamic | Array |
[]
|
[]
| 滚动动态列表
**格式见下文**
|
### dynamic 格式
```
json
[
"寒雨连江夜入吴"
,
"平明送客楚山孤"
,
"洛阳亲友如相问"
,
"一片冰心在玉壶"
]
```
### Events
| 事件称名 | 说明 | 返回值 |
| :------: | :------------------: | :----: |
| @answer | 点击每日一练按钮触发 | 无 |
## 组件用法
### 基础用法
```
html
<subject-statistics
:days=
"40"
:today=
"97"
:total=
"668"
:dynamic=
"list"
@
answer=
"answer"
></subject-statistics>
```
```
javascript
import
subjectStatistics
from
'@/components/subject-statistics/index.vue'
export
default
{
components
:
{
subjectStatistics
,
},
data
()
{
return
{
list
:
[
'寒雨连江夜入吴'
,
'平明送客楚山孤'
,
'洛阳亲友如相问'
,
'一片冰心在玉壶'
,
],
}
},
methods
:
{
answer
()
{
console
.
log
(
'每日一练'
)
},
},
}
```
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