Demo:输入的标签数据为空不允许添加

This commit is contained in:
街角小林 2024-08-21 09:02:55 +08:00
parent 3c63d94d9c
commit 8a36675b8d

View File

@ -102,7 +102,9 @@ export default {
* @Desc: 添加
*/
add() {
this.tagArr.push(this.tag)
const text = this.tag.trim()
if (!text) return
this.tagArr.push(text)
this.tag = ''
},