diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2019-05-06 20:09:13 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2019-05-06 20:09:13 +0900 |
| commit | 187792dfc4d1d1d16412da92ec71654d489228bc (patch) | |
| tree | 2247c0ddab333ca4367b88a5b6e19083582ddd57 /src | |
| parent | Resolve #4864 (#4865) (diff) | |
| download | sharkey-187792dfc4d1d1d16412da92ec71654d489228bc.tar.gz sharkey-187792dfc4d1d1d16412da92ec71654d489228bc.tar.bz2 sharkey-187792dfc4d1d1d16412da92ec71654d489228bc.zip | |
Fix bug
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/app/common/views/components/ui/select.vue | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/client/app/common/views/components/ui/select.vue b/src/client/app/common/views/components/ui/select.vue index e8b45a4a29..ec5145ca30 100644 --- a/src/client/app/common/views/components/ui/select.vue +++ b/src/client/app/common/views/components/ui/select.vue @@ -5,10 +5,9 @@ <span class="label" ref="label"><slot name="label"></slot></span> <div class="prefix" ref="prefix"><slot name="prefix"></slot></div> <select ref="input" - :value="v" + v-model="v" :required="required" :disabled="disabled" - @input="$emit('input', $event.target.value)" @focus="focused = true" @blur="focused = false" > @@ -56,20 +55,22 @@ export default Vue.extend({ }, data() { return { - v: this.value, focused: false }; }, computed: { + v: { + get() { + return this.value; + }, + set(v) { + this.$emit('input', v); + } + }, filled(): boolean { return this.v != '' && this.v != null; } }, - watch: { - value(v) { - this.v = v; - } - }, mounted() { if (this.$refs.prefix) { this.$refs.label.style.left = (this.$refs.prefix.offsetLeft + this.$refs.prefix.offsetWidth) + 'px'; |