Skip to content

Instantly share code, notes, and snippets.

@JimYaaa
Last active September 19, 2021 16:36
Show Gist options
  • Save JimYaaa/59500e599114b7720cacdc5a20083c27 to your computer and use it in GitHub Desktop.
Save JimYaaa/59500e599114b7720cacdc5a20083c27 to your computer and use it in GitHub Desktop.
vue 2 two way binding prop
// ChildComponent.vue
export default {
model: {
prop: 'title',
event: 'change'
},
props: {
// title 取代 value
title: {
type: String,
default: 'Default title'
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment