Skip to content

How to simulate 'v-model' using render function while rendering Vue-Select? (Vue 2) #1613

Discussion options

You must be logged in to vote
data() {
	return { selected: null };
},
render(h) {
	  h(vSelect, {
	     props: { value: this.selected },
	     on: { input: (value) => this.selected = value }
	  })
}

👆 that's the key to getting things to work. Pass the value prop, and bind the input event. Here's a complete example: https://codepen.io/sagalbot/pen/RwxGRgM

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sagalbot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants