Skip to content

Instantly share code, notes, and snippets.

@asselin
Last active March 24, 2017 20:26
Show Gist options
  • Select an option

  • Save asselin/4bd0308931f6e809eaa69b005c3ad6c2 to your computer and use it in GitHub Desktop.

Select an option

Save asselin/4bd0308931f6e809eaa69b005c3ad6c2 to your computer and use it in GitHub Desktop.
Code snippets for "Tech note: Using VueJS events together with v-model"
<template>
<label role="radio" tabindex="0">
<input type="radio" v-on:something="clicked" name="r1" value="One" v-model="picked">
<span>One</span>
</label>
<label role="radio" tabindex="0">
<input type="radio" v-on:something="clicked" name="r1" value="Two" v-model="picked">
<span>Two</span>
</label>
</template>
<script>
// ...
methods: {
clicked: function() {
console.log(this.picked);
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment