Skip to content

Commit

Permalink
Update if.md
Browse files Browse the repository at this point in the history
  • Loading branch information
wssn authored Jun 13, 2021
1 parent cbbf418 commit 1517fc4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/docs/src/en/directives/if.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: if

# `x-if`

`x-if` is used for toggling elements on the page, similarly to `x-show`, however it completely adds and removes the elememt it's applied to rather than just changing its CSS display property to "hidden".
`x-if` is used for toggling elements on the page, similarly to `x-show`, however it completely adds and removes the element it's applied to rather than just changing its CSS display property to "hidden".

Because of this difference in behavior, `x-if` should not be applied directly to the element, but instead to a `<template>` tag that encloses the element. This way, Alpine can keep a record of the element once it's removed from the page.

Expand Down

0 comments on commit 1517fc4

Please sign in to comment.