发布帖子时如果没上传封面增加提示

main
Hacker-00001 4 weeks ago
parent 5eee2f8e14
commit 81a0768f0a

@ -146,6 +146,10 @@ export default {
showResult('error', '请填写完整信息')
return
}
if (!form.value.image) {
showResult('error', '请先选择帖子封面')
return
}
if (form.value.title.length < 3 || form.value.title.length > 50) {
showResult('error', '标题长度需3-50字符')
return
@ -200,7 +204,6 @@ export default {
</script>
<style scoped>
/* 新增/修改的样式 */
.upload-wrapper {
display: flex;
align-items: center;
@ -268,7 +271,6 @@ export default {
font-size: 12px;
}
/* 原有样式优化(保持整体风格一致) */
.post-container {
max-width: 600px;
margin: 30px auto;
@ -381,5 +383,4 @@ export default {
background: #fde2e2;
color: #c0392b;
}
</style>
</style>
Loading…
Cancel
Save