I've been attempting to achieve the following in Vue.js, but I keep encountering an error that says
[plugin:vite:vue] Unexpected token (1:27)
:
@click="selectedFiles.push(file.id); selectedFiles.length < 1 ? isCollapse=false: isCollapse=true"
Essentially, when this image is clicked:
- It should add the file to the selectedFiles array
- .. and then check if the length is less than 1 and adjust the isCollapse boolean accordingly.
The code functions properly without the ternary operation, leading me to believe it may be a syntax issue.