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
5a52bcf8
Commit
5a52bcf8
authored
Jul 08, 2021
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 科目状态提示组件
parent
f4c05ea9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
0 deletions
+78
-0
index.vue
src/components/subject-tips/index.vue
+47
-0
readme.md
src/components/subject-tips/readme.md
+31
-0
No files found.
src/components/subject-tips/index.vue
0 → 100644
View file @
5a52bcf8
<
template
>
<view
class=
"u-flex u-row-around tips"
>
<view
class=
"title"
>
{{
title
}}
</view>
<view
class=
"validity"
v-if=
"validity && status === 2"
>
有效期至:
{{
validity
}}
</view>
</view>
</
template
>
<
script
>
const
title
=
[
'请选择题库...'
,
'绑卡或购买该题库后,即可开始刷题...'
,
'刷题备考中...'
]
export
default
{
name
:
'subjectTips'
,
props
:
{
status
:
{
type
:
Number
,
default
:
0
,
},
validity
:
{
type
:
String
,
default
:
''
,
}
},
data
()
{
return
{
}
},
computed
:
{
title
()
{
return
title
[
this
.
status
]
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.tips
{
width
:
100%
;
background
:
#fbfbfb
;
padding
:
20rpx
40rpx
;
font-size
:
26rpx
;
.title
{
flex
:
1
}
}
</
style
>
src/components/subject-tips/readme.md
0 → 100644
View file @
5a52bcf8
## 科目状态提示
```
科目状态提示组件,用于首页展示科目状态提示
```
## API
### Props
| 属性名 | 类型 | 默认值 | 可选值 | 说明 |
| :------: | :----: | :----: | :----: | :------------------------------------------------------: |
| status | Number | 0 | 1,2 | 当前状态(0.未选题库 1.已选科目未绑卡 2.已选科目已绑卡) |
| validity | String | - | - | 有效期, 状态等于 2 的时候需传 |
## 组件用法
### 基础用法
```
html
<subject-tips
:status=
"2"
validity=
"2012.09.02"
></subject-tips>
```
```
javascript
import
subjectTips
from
'@/components/subject-tips/index.vue'
export
default
{
components
:
{
subjectTips
,
},
}
```
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