Skip to content

Instantly share code, notes, and snippets.

@cayasso
Created February 20, 2017 22:56
Show Gist options
  • Save cayasso/364dbb386ec764806cd80e135634f563 to your computer and use it in GitHub Desktop.
Save cayasso/364dbb386ec764806cd80e135634f563 to your computer and use it in GitHub Desktop.
Select Issue in Svelte
<select ref:select on:change="doChange(event)">
<option value="{{item.key}}">{{item.title}}</option>
<option value="two">Two</option>
<option value="three">Three</option>
</select>
<div>Selected Value: {{value}}</div>
<script>
export default {
data() {
return {
"item": {
"title": "Tierras del cafe",
"key": "tierrasdelcafe"
},
"value": "none"
}
},
methods: {
doChange() {
console.log(component.refs.select.value);
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment