Commit 9497f9d6 authored by Damon's avatar Damon

feat: 我的题库组件

parent d8a9fcb5
<template>
<view class="u-flex my-details">
<view class="u-flex u-row-between top">
<view>{{ time }}</view>
<view>{{ status }}</view>
</view>
<view class="u-flex bottom">
<view class="title">{{ title }}</view>
<view class="subtitle">{{ subtitle }}</view>
</view>
</view>
</template>
<script>
export default {
name: 'mySubject',
props: {
time: {
type: String,
default: '',
},
status: {
type: String,
default: '',
},
title: {
type: String,
default: '',
},
subtitle: {
type: String,
default: '',
},
},
}
</script>
<style lang="scss" scoped>
.my-details {
width: 100%;
flex-flow: column;
background: #fbfbfb;
.top {
width: 100%;
font-size: 24rpx;
color: #797979;
padding: 20rpx;
}
.bottom {
width: 100%;
flex-flow: column;
padding: 30rpx 20rpx;
border-top: 1px solid #fff;
.title {
flex: 1;
margin-right: auto;
font-size: 32rpx;
color: #101010;
}
.subtitle {
flex: 1;
margin-right: auto;
margin-top: 20rpx;
font-size: 24rpx;
color: #ff9e62;
}
}
}
</style>
## 我的题库
```
我的题库组件,用于个人中心题库展示
```
## API
### Props
| 属性名 | 类型 | 默认值 | 可选值 | 说明 |
| :------: | :----: | :----: | :----: | :--------------------: |
| time | String | - | - | 绑卡成功或支付成功时间 |
| status | String | - | - | 题库状态 |
| title | String | - | - | 标题/题库名称 |
| subtitle | String | - | - | 副标题 |
## 组件用法
### 基础用法
```html
<my-subject
v-for="(item, index) in lists"
:key="index"
:time="item.time"
:status="item.status"
:title="item.title"
:subtitle="item.subtitle"
></my-subject>
```
```javascript
import mySubject from '@/components/my-subject/index.vue'
export default {
components: {
mySubject,
},
data() {
return {
lists: [
{
time: '2021.06.25 18:06',
status: '已激活',
title: '高处安装、维护、拆除作业人员',
subtitle: '题库将于48天后到期',
},
{
time: '2021.05.25 14:05',
status: '已绑定',
title: '高处安装、维护、拆除作业人员',
subtitle: '题库将于88天后到期',
},
{
time: '2021.07.25 11:06',
status: '已失效',
title: '高处安装、维护、拆除作业人员',
subtitle: '题库已过期',
},
],
}
},
}
```
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment