Created
February 20, 2017 22:56
-
-
Save cayasso/364dbb386ec764806cd80e135634f563 to your computer and use it in GitHub Desktop.
Select Issue in Svelte
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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