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
3329c8e6
Commit
3329c8e6
authored
Jul 08, 2021
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 科目基本信息组件
parent
5a52bcf8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
137 additions
and
0 deletions
+137
-0
index.vue
src/components/subject-base/index.vue
+82
-0
readme.md
src/components/subject-base/readme.md
+55
-0
No files found.
src/components/subject-base/index.vue
0 → 100644
View file @
3329c8e6
<
template
>
<view
class=
"u-flex u-row-around details"
@
tap
.
stop=
"click"
>
<view>
<u-icon
:name=
"icons"
size=
"50"
></u-icon>
</view>
<view
class=
"u-flex details-center"
>
<view
class=
"name"
>
{{
getName
}}
</view>
<view
class=
"more"
v-if=
"status === 0"
>
题数:/
</view>
<view
class=
"more"
v-else
>
{{
location
}}
题数:
{{
quantity
}}
通过率:
{{
pass
}}
</view>
</view>
<view
v-if=
"status !== 0"
>
<u-icon
name=
"arrow-right"
size=
"30"
></u-icon>
</view>
</view>
</
template
>
<
script
>
export
default
{
name
:
'subjectDetails'
,
props
:
{
status
:
{
type
:
Number
,
default
:
0
,
},
name
:
{
type
:
String
,
default
:
''
,
},
location
:
{
type
:
String
,
default
:
''
,
},
quantity
:
{
type
:
Number
,
default
:
0
,
},
pass
:
{
type
:
String
,
default
:
''
,
},
},
data
()
{
return
{}
},
computed
:
{
icons
()
{
return
this
.
status
===
0
?
'info-circle'
:
'info-circle-fill'
},
getName
()
{
return
this
.
status
===
0
?
'点击选择您将要参加的考试'
:
this
.
name
},
},
methods
:
{
click
()
{
this
.
$emit
(
'click'
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.details
{
width
:
100%
;
background
:
#fbfbfb
;
padding
:
20rpx
40rpx
;
.details-center
{
flex
:
1
;
flex-flow
:
column
;
padding-left
:
40rpx
;
.name
{
font-size
:
32rpx
;
color
:
#101010
;
margin-right
:
auto
;
}
.more
{
font-size
:
24rpx
;
color
:
#797979
;
margin-right
:
auto
;
padding-top
:
20rpx
;
}
}
}
</
style
>
src/components/subject-base/readme.md
0 → 100644
View file @
3329c8e6
## 科目基础信息
```
科目基础信息组件,用于首页展示科目基础信息
```
## API
### Props
| 属性名 | 类型 | 默认值 | 可选值 | 说明 |
| :------: | :----: | :----: | :----: | :------------------------------------------------------: |
| status | Number | 0 | 1,2 | 当前状态(1.未选题库 2.已选科目未绑卡 3.已选科目已绑卡) |
| name | String | - | - | 科目名称 |
| location | String | - | - | 题库归属地 |
| quantity | Number | 0 | - | 题数 |
| pass | String | - | - | 通过率 |
### Events
| 事件称名 | 说明 | 返回值 |
| :------: | :--------------: | :----: |
| @click | 点击任意位置触发 | 无 |
## 组件用法
### 基础用法
```
html
<subject-base
:status=
"1"
name=
"高处安装、维护、拆除作业人员"
location=
"广东省题"
:quantity=
"667"
pass=
"96%"
@
click=
"subjectClick"
></subject-base>
```
```
javascript
import
subjectBase
from
'@/components/subject-base/index.vue'
export
default
{
components
:
{
subjectBase
,
},
data
()
{
return
{}
},
methods
:
{
subjectClick
()
{
console
.
log
(
'1'
,
1
)
},
},
}
```
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