Fix event handlers

Fix event handlers with multiple lines of code in the Vue template.
This commit is contained in:
timongh 2023-03-09 17:34:51 +08:00
parent 0765347525
commit 87189cc05e
2 changed files with 17 additions and 9 deletions

View File

@ -32,8 +32,10 @@
@next-item="nextItem($event, index)"
@delete-item="onDeleteItem($event, index)"
@action="
index === actions.length - 1 && onClearHistory()
onAction()
() => {
index === actions.length - 1 && onClearHistory()
onAction()
}
"
/>
</div>

View File

@ -47,8 +47,10 @@
<VButton
:disabled="!addImagePopupOpen"
@click="
addImagePopupOpen = false
clearNewImage()
() => {
addImagePopupOpen = false
clearNewImage()
}
"
>
取消
@ -57,9 +59,11 @@
:disabled="!newImage.url || !newImage.name"
type="primary"
@click="
addImage(newImage)
addImagePopupOpen = false
clearNewImage()
() => {
addImage(newImage)
addImagePopupOpen = false
clearNewImage()
}
"
>
确定
@ -83,8 +87,10 @@
<VButton
:disabled="!selectedImage.name"
@click="
removeImage(selectedImage)
clearImage()
() => {
removeImage(selectedImage)
clearImage()
}
"
>
删除