提交 523bbbb5 authored 作者: 王鹏飞's avatar 王鹏飞

chore:课程作业简答题增加表单校验

上级 c63d00a8
......@@ -86,11 +86,14 @@ export default {
}
},
chapterWork: {
immediate: true,
handler(data) {
this.questions = data.questions.map(item => {
return Object.assign({}, item, { file_url: '', descreption: '' })
})
this.loadAjax()
if (data.questions && data.questions.length) {
this.questions = data.questions.map(item => {
return Object.assign({}, item, { file_url: '', descreption: '' })
})
this.loadAjax()
}
}
}
},
......@@ -143,6 +146,11 @@ export default {
}, 500)
},
submitWork() {
const emptyValue = this.questions.find(item => item.descreption === '')
if (emptyValue) {
this.$message.error('请填写内容')
return
}
const loading = this.$loading({
lock: true,
text: '',
......@@ -183,3 +191,9 @@ export default {
}
}
</script>
<style lang="scss" scoped>
::v-deep .upload {
margin: 10px 0 20px;
}
</style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论