Skip to content

Instantly share code, notes, and snippets.

@y-nk
Last active March 13, 2020 04:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save y-nk/54fc14a8f4e3d485708685f820f87744 to your computer and use it in GitHub Desktop.
Save y-nk/54fc14a8f4e3d485708685f820f87744 to your computer and use it in GitHub Desktop.
const BadGoose = () => (<div>shown!</div>)
const App = (props) => {
const [toggle, setToggle] = useState(true)
return (<div>
<button onClick={() => setToggle(!toggle)}>click me</div>
{ toggle ? <BadGoose /> : null }
</div>)
}
const BadGoose = {
template: '<div>shown!</div>',
}
const App = {
components: { BadGoose },
template: `<div>
<button @click="toggle = !toggle">click me</button>
<bad-goose v-if="toggle" />
</div>`,
data: () => ({ toggle: true })
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment