Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-qa
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-qa
Commits
56887b98
提交
56887b98
authored
3月 01, 2022
作者:
lihuihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改bug
上级
b75b6172
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
11 行增加
和
24 行删除
+11
-24
QTypeRadio.vue
src/modules/question/components/QTypeRadio.vue
+11
-24
没有找到文件。
src/modules/question/components/QTypeRadio.vue
浏览文件 @
56887b98
<
template
>
<div
class=
"radio-box"
>
<template
v-for=
"(item, index) in option
|| datas
"
>
<template
v-for=
"(item, index) in option"
>
<div
class=
"opt"
:key=
"index"
>
<el-radio
v-model=
"radioValue"
:label=
"index"
@
change=
"radioChange"
>
<el-tag>
{{
A_Z
()[
index
]
}}
</el-tag>
<el-input
v-model=
"item.option"
maxlength=
"80"
show-word-limit
></el-input>
</el-radio>
<i
class=
"el-icon-remove-outline icon-style"
v-if=
"index !=
datas
.length - 1"
@
click=
"remove(index)"
></i>
<i
class=
"el-icon-remove-outline icon-style"
v-if=
"index !=
option
.length - 1"
@
click=
"remove(index)"
></i>
<i
class=
"el-icon-circle-plus-outline icon-style"
v-else
@
click=
"add"
></i>
</div>
</
template
>
...
...
@@ -23,36 +23,22 @@ export default {
data
()
{
return
{
radioValue
:
0
,
datas
:
[
{
checked
:
true
,
option
:
''
},
{
checked
:
false
,
option
:
''
},
{
checked
:
false
,
option
:
''
}
],
ruleForm
:
''
}
},
mounted
()
{
if
(
this
.
option
)
{
this
.
datas
=
this
.
option
this
.
radioValue
=
this
.
datas
.
findIndex
(
item
=>
item
.
checked
)
}
this
.
radioValue
=
this
.
option
.
findIndex
(
item
=>
item
.
checked
)
},
methods
:
{
// 添加选项
add
()
{
this
.
datas
.
push
({
option
:
''
,
checked
:
false
})
this
.
option
.
push
({
option
:
''
,
checked
:
false
,
id
:
0
})
},
// 删除选项
remove
(
index
)
{
this
.
datas
.
splice
(
index
,
1
)
this
.
option
.
splice
(
index
,
1
)
},
// ABCD
A_Z
()
{
const
result
=
[]
for
(
let
i
=
0
;
i
<
26
;
i
++
)
{
...
...
@@ -60,10 +46,11 @@ export default {
}
return
result
},
// 选择正确答案
radioChange
()
{
this
.
datas
.
map
(
item
=>
{
this
.
option
.
map
(
item
=>
{
item
.
checked
=
false
this
.
datas
[
this
.
radioValue
].
checked
=
true
this
.
option
[
this
.
radioValue
].
checked
=
true
return
item
})
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论