Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
JJ_EXAM
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
template admin
JJ_EXAM
Commits
86fff574
Commit
86fff574
authored
Mar 12, 2026
by
JinWei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加正确选项的key
parent
ff02c222
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
6 deletions
+22
-6
.nvmrc
.nvmrc
+1
-0
browserslist
browserslist
+7
-5
form.component.ts
src/app/form/form.component.ts
+14
-1
No files found.
.nvmrc
0 → 100644
View file @
86fff574
10.24.1
\ No newline at end of file
browserslist
View file @
86fff574
...
...
@@ -5,8 +5,10 @@
# You can see what browsers were selected by your queries by running:
# npx browserslist
> 0.5%
last 2 versions
Firefox ESR
not dead
not IE 9-11 # For IE 9-11 support, remove 'not'.
\ No newline at end of file
# Targeting modern browsers only — disables ES5 differential loading bundle, speeds up build significantly.
last 2 Chrome versions
last 2 Firefox versions
last 2 Edge versions
last 2 Safari versions
last 2 iOS versions
not IE 9-11
\ No newline at end of file
src/app/form/form.component.ts
View file @
86fff574
...
...
@@ -48,6 +48,17 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
if
(
!
this
.
item
.
questionArr
)
{
this
.
item
.
questionArr
=
[];
}
this
.
item
.
questionArr
.
forEach
(
q
=>
{
if
(
q
.
optionArr
)
{
this
.
syncOptionKeys
(
q
.
optionArr
);
}
});
}
syncOptionKeys
(
optionArr
:
any
[])
{
optionArr
.
forEach
((
option
,
index
)
=>
{
option
.
key
=
this
.
getOptionLabel
(
index
);
});
}
addQuestion
()
{
...
...
@@ -73,7 +84,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
}
getOptionLabel
(
index
:
number
):
string
{
const
labels
=
[
'
A
'
,
'
B
'
,
'
C
'
,
'
D
'
,
'
E
'
,
'
F
'
,
'
G
'
,
'
H
'
,
'
I
'
,
'
J
'
];
const
labels
=
[
'
A
'
,
'
B
'
,
'
C
'
,
'
D
'
,
'
E
'
,
'
F
'
,
'
G
'
,
'
H
'
,
'
I
'
,
'
J
'
,
'
K
'
,
'
L
'
,
'
M
'
,
'
N
'
];
return
labels
[
index
]
!==
undefined
?
labels
[
index
]
:
String
(
index
+
1
);
}
...
...
@@ -82,11 +93,13 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
ques
.
optionArr
=
[];
}
ques
.
optionArr
.
push
({});
this
.
syncOptionKeys
(
ques
.
optionArr
);
this
.
save
();
}
deleteOptionBtnClick
(
arr
,
i
)
{
arr
.
splice
(
i
,
1
);
this
.
syncOptionKeys
(
arr
);
this
.
save
();
}
...
...
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