0
You don’t need
<button @click="clicked"></button>
Button is of type="submit"
which means that addMember is invoked only if button is clicked.
Also, i would define another ref, for example
const error = ref(null)
You can check inside addMember if memberName.value is not empty.
For example
if(!memberName.value) {
error.value = true
return
}
And then use it for conditional rendering.
- [Vuejs]-Vite problem: element-plus can not use import type
- [Vuejs]-Vue Storefront keeps giving error showing products
Source:stackexchange.com