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
2f7f9c8e
Commit
2f7f9c8e
authored
Jul 07, 2021
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: 答案解释组件
parent
bedd2bb3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
5 deletions
+20
-5
index.vue
src/components/answer-explanation/index.vue
+12
-5
readme.md
src/components/answer-explanation/readme.md
+0
-0
readme.md
src/components/answer-sheet/readme.md
+1
-0
index.vue
src/pages/index/index.vue
+7
-0
No files found.
src/components/
wrong
-explanation/index.vue
→
src/components/
answer
-explanation/index.vue
View file @
2f7f9c8e
<
template
>
<
template
>
<view
class=
"card"
>
<view
class=
"card"
>
<u-card
title=
"答错了
"
padding=
"10"
:thumb=
"thumb"
>
<u-card
:title=
"title
"
padding=
"10"
:thumb=
"thumb"
>
<view
class=
"u-flex content"
slot=
"body"
>
<view
class=
"u-flex content"
slot=
"body"
>
<view
class=
"lists"
>
正确答案:
{{
answer
}}
</view>
<view
class=
"lists"
>
正确答案:
{{
answer
}}
</view>
<view
class=
"lists"
>
解释说明:
{{
explain
}}
</view>
<view
class=
"lists"
>
解释说明:
{{
explain
}}
</view>
</view>
</view>
</u-card>
</u-card>
...
@@ -13,6 +13,10 @@
...
@@ -13,6 +13,10 @@
export
default
{
export
default
{
name
:
'answerSheet'
,
name
:
'answerSheet'
,
props
:
{
props
:
{
type
:
{
type
:
String
,
default
:
'wrong'
,
},
answer
:
{
answer
:
{
type
:
String
,
type
:
String
,
default
:
''
,
default
:
''
,
...
@@ -22,13 +26,16 @@ export default {
...
@@ -22,13 +26,16 @@ export default {
default
:
''
,
default
:
''
,
},
},
},
},
computed
:
{
title
()
{
return
this
.
type
===
'right'
?
'答对了'
:
'答错了'
}
},
data
()
{
data
()
{
return
{
return
{
thumb
:
'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg'
,
thumb
:
'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg'
,
}
}
},
}
created
()
{},
methods
:
{},
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
>
<
style
lang=
"scss"
>
...
...
src/components/
wrong
-explanation/readme.md
→
src/components/
answer
-explanation/readme.md
View file @
2f7f9c8e
File moved
src/components/answer-sheet/readme.md
View file @
2f7f9c8e
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
| 属性名 | 类型 | 默认值 | 可选值 | 说明 |
| 属性名 | 类型 | 默认值 | 可选值 | 说明 |
| :--------: | :-----: | :----: | :--------: | :---------------------: |
| :--------: | :-----: | :----: | :--------: | :---------------------: |
| type | String | wrong | right | 答对还是答错 |
| multiple | Boolean | false | true/false | 是否支持多选 |
| multiple | Boolean | false | true/false | 是否支持多选 |
| answerList | Array |
[]
| - | 答案列表
**格式见下文**
|
| answerList | Array |
[]
| - | 答案列表
**格式见下文**
|
...
...
src/pages/index/index.vue
View file @
2f7f9c8e
...
@@ -4,11 +4,18 @@
...
@@ -4,11 +4,18 @@
<view>
<view>
<text
class=
"title"
>
{{
title
}}
</text>
<text
class=
"title"
>
{{
title
}}
</text>
</view>
</view>
<view
style=
"margin-top: 200rpx; width: 100%;"
>
<answer-explanation
answer=
"A"
explain=
"无"
></answer-explanation>
</view>
</view>
</view>
</
template
>
</
template
>
<
script
>
<
script
>
import
answerExplanation
from
'@/components/answer-explanation/index.vue'
export
default
{
export
default
{
components
:
{
answerExplanation
},
data
()
{
data
()
{
return
{
return
{
title
:
'Hello'
title
:
'Hello'
...
...
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