2
0
mirror of https://github.com/frappe/books.git synced 2024-12-25 12:10:06 +00:00
books/ui/components/controls/Select.vue
2018-07-12 16:59:10 +05:30

32 lines
763 B
Vue

<script>
import Base from './Base';
export default {
extends: Base,
methods: {
getInputTag() {
return 'select';
},
getInputAttrs() {
return {
id: this.id,
required: this.docfield.required,
disabled: this.disabled
};
},
getInputChildren(h) {
return this.docfield.options.map(option =>
h('option', {
attrs: {
key: option,
selected: option === this.value
},
domProps: {
textContent: option
}
})
);
}
}
}
</script>