Skip to content

Instantly share code, notes, and snippets.

@enkot
Last active July 21, 2019 20:06
Show Gist options
  • Save enkot/93abaa0e8d33e048228b08eb9f62c812 to your computer and use it in GitHub Desktop.
Save enkot/93abaa0e8d33e048228b08eb9f62c812 to your computer and use it in GitHub Desktop.
// ...
<script>
import { value } from 'vue-function-api'
const TestComponent = {
props: {
name: String
},
setup(props) {
const message = value('Hello guest!')
const getName = () => {
message.value = `Hello ${props.name}!`
}
return {
message,
getName
}
},
template: `<div @click="getName">{{ message }}</div>`
}
</script>
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment