遍历赋值

Object.keys(this.$route.query).forEach(item => {
this[item] = this.$route.query[item]
})
this.$route.query-------------------{examRecordId: '1595345737233141762', paperId: '1600027505360248834', classId: '20267', totalPaper: '10', markPaper: '2'}
posted @ 2022-12-28 16:09  士广  阅读(47)  评论(0)    收藏  举报