Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoubichuan committed Oct 5, 2023
1 parent d119635 commit 73ea716
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion model/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,10 @@ for (let i = 0; i < targetArray.length; i++) {
pre[cur.name] = {
type: fieldTypes[cur.type],
set(value) {
if (["array", "object"].includes(cur.type)) {
if (
["array", "object"].includes(cur.type) &&
typeof value === "string"
) {
return JSON.parse(value);
} else {
return value;
Expand Down

0 comments on commit 73ea716

Please sign in to comment.