Skip to content

Commit

Permalink
Target the correct parent element for removeal
Browse files Browse the repository at this point in the history
Fixes #87
  • Loading branch information
imacrayon committed Aug 15, 2024
1 parent 7a67e4b commit a532efc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/examples/notifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ Now our messages will smoothly transition in and out as they are added and remov
},
dismiss() {
this.show = false
setTimeout(() => this.$el.remove(), 500)
setTimeout(() => this.$root.remove(), 500)
}
}"
x-show="show"
x-transition.duration.500ms
>
<span>The button was clicked 1 time.</span>
<button @click="dismiss()" type="button" aria-label="Dismiss">&times;</button>
<button @click="dismiss" type="button" aria-label="Dismiss">&times;</button>
</li>
```

Expand All @@ -89,14 +89,14 @@ And finally, we can make our notifications automatically dismiss after 6 seconds
},
dismiss() {
this.show = false
setTimeout(() => this.$el.remove(), 500)
setTimeout(() => this.$root.remove(), 500)
}
}"
x-show="show"
x-transition.duration.500ms
>
<span>The button was clicked 1 time.</span>
<button @click="dismiss()" type="button" aria-label="Dismiss">&times;</button>
<button @click="dismiss" type="button" aria-label="Dismiss">&times;</button>
</li>
```

Expand Down Expand Up @@ -151,14 +151,14 @@ And finally, we can make our notifications automatically dismiss after 6 seconds
},
dismiss() {
this.show = false
setTimeout(() => this.$el.remove(), 500)
setTimeout(() => this.$root.remove(), 500)
}
}"
x-show="show"
x-transition.duration.500ms
>
<span>The button was clicked ${count} ${count > 1 ? 'times' : 'time'}.</span>
<button @click="dismiss()" type="button" aria-label="Dismiss">&times;</button>
<button @click="dismiss" type="button" aria-label="Dismiss">&times;</button>
</li>`
}
</script>

0 comments on commit a532efc

Please sign in to comment.