Commit 165b1f26 by Jaxon

fix(select): 修复下拉选项前置全部项时的空数组访问错误

避免当optionList为空时访问不存在的首个元素,防止运行时报错
1 parent 16d54282
......@@ -5,7 +5,7 @@
export function setAllOptions(list) {
list.forEach((item, index) => {
if (item.type === "select") {
if (item.optionList[0][item.optionLabel] !== "全部") {
if (item.optionList.length && item.optionList[0][item.optionLabel] !== "全部") {
item.optionList.unshift({
[item.optionId]: "",
[item.optionLabel]: "全部",
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!