Files
mixtape/zero.Backoffice.UI/app/modules/languages/field-languagepicker.vue
T

39 lines
739 B
Vue
Raw Normal View History

2021-12-15 22:01:20 +01:00
<template>
2021-12-21 14:41:50 +01:00
<div class="ui-native-select" :disabled="config.disabled">
<select :value="value" @input="onChange($event)" :disabled="config.disabled">
2021-12-09 10:51:10 +01:00
<option :value="null"></option>
<option v-for="item in items" :value="item.id">{{item.name}}</option>
</select>
</div>
</template>
<script>
2021-12-21 13:58:48 +01:00
import api from './api';
2021-12-09 10:51:10 +01:00
export default {
props: {
2021-12-21 13:58:48 +01:00
value: String,
2021-12-21 14:41:50 +01:00
config: Object
2021-12-09 10:51:10 +01:00
},
data: () => ({
items: []
}),
2021-12-21 13:58:48 +01:00
async mounted()
2021-12-09 10:51:10 +01:00
{
2021-12-21 14:41:50 +01:00
const result = await api.getByQuery({}, { system: this.config.system });
2021-12-21 13:58:48 +01:00
this.items = result.data;
2021-12-09 10:51:10 +01:00
},
methods: {
onChange(e)
{
this.$emit('input', e.target.value || null);
}
}
}
2021-12-15 22:01:20 +01:00
</script>