Vue.js中如何使checked数组与symptoms数组长度一致
"const symptoms = reactive({});\n\nconst checked = reactive({});\n\nasync function onVisibleChange(visible) {\n if (visible) {\n const symptom = await defHttp.get({ url: '/checkItemDetail/checkItemDetail/getSymptom' });\n Object.assign(symptoms, symptom);\n checked.value = Array(symptoms.value.length).fill(false);\n }\n}\n\n"\n\n这样,checked就会成为一个与symptoms长度一致的数组,并且每个元素的初始值都为false。
原文地址: https://www.cveoy.top/t/topic/p1xh 著作权归作者所有。请勿转载和采集!