2019-11-24 14:16:24 +01:00
|
|
|
<template>
|
|
|
|
<div class="select">
|
2020-09-05 22:35:52 +02:00
|
|
|
<select :disabled="disabled" @change="updateData" v-model="priority">
|
2019-11-24 14:16:24 +01:00
|
|
|
<option :value="priorities.UNSET">Unset</option>
|
|
|
|
<option :value="priorities.LOW">Low</option>
|
|
|
|
<option :value="priorities.MEDIUM">Medium</option>
|
|
|
|
<option :value="priorities.HIGH">High</option>
|
|
|
|
<option :value="priorities.URGENT">Urgent</option>
|
|
|
|
<option :value="priorities.DO_NOW">DO NOW</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-09-05 22:35:52 +02:00
|
|
|
import priorites from '../../../models/priorities'
|
2019-11-24 14:16:24 +01:00
|
|
|
|
2020-09-05 22:35:52 +02:00
|
|
|
export default {
|
|
|
|
name: 'prioritySelect',
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
priorities: priorites,
|
|
|
|
priority: 0,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
value: {
|
|
|
|
default: 0,
|
|
|
|
type: Number,
|
2019-11-24 14:16:24 +01:00
|
|
|
},
|
2020-09-05 22:35:52 +02:00
|
|
|
disabled: {
|
|
|
|
default: false,
|
2019-11-24 14:16:24 +01:00
|
|
|
},
|
2020-09-05 22:35:52 +02:00
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
// Set the priority to the :value every time it changes from the outside
|
|
|
|
value(newVal) {
|
|
|
|
this.priority = newVal
|
2019-11-24 14:16:24 +01:00
|
|
|
},
|
2020-09-05 22:35:52 +02:00
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
this.priority = this.value
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
updateData() {
|
|
|
|
this.$emit('input', this.priority)
|
|
|
|
this.$emit('change')
|
2019-11-24 14:16:24 +01:00
|
|
|
},
|
2020-09-05 22:35:52 +02:00
|
|
|
},
|
|
|
|
}
|
2019-11-24 14:16:24 +01:00
|
|
|
</script>
|