data() { return { selectSchoolId: this.$route.query.schoolId, schoolList: [] }; }
找了半天发现selectSchoolId获取的是字符串,导致显示结果为1,而不是对应的label值。
解决方案:
selectSchoolId: this.$route.query.schoolId? this.$route.query.schoolId * 1: ""
本文共 294 字,大约阅读时间需要 1 分钟。
data() { return { selectSchoolId: this.$route.query.schoolId, schoolList: [] }; }
找了半天发现selectSchoolId获取的是字符串,导致显示结果为1,而不是对应的label值。
解决方案:
selectSchoolId: this.$route.query.schoolId? this.$route.query.schoolId * 1: ""
转载于:https://my.oschina.net/xiaoxustudent/blog/1590275