Created
January 8, 2016 10:24
-
-
Save asvae/878b962ba9154c581802 to your computer and use it in GitHub Desktop.
This file contains 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
<template> | |
<select name="name" class="form-control" v-model="value"> | |
<option :value="null" :selected="value === null">{{noProgrammer}} | |
</option> | |
<option v-for="(user_id, user_name) in apiProgrammers.data" | |
:value="user_id" :selected="value == user_id" | |
v-text="user_name"></option> | |
</select> | |
</template> | |
<script> | |
module.exports = { | |
data: function () { | |
return { | |
null: null, // NOTE Required for select to support null value. | |
apiProgrammers: this.$api.load('users/programmers'), | |
noProgrammer: 'Не назначен' | |
} | |
}, | |
props: { | |
name: {type: String}, | |
value: {}, | |
}, | |
}; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment