2
0
mirror of https://github.com/frappe/books.git synced 2024-11-14 01:14:03 +00:00
books/ui/components/controls/Select.vue

32 lines
763 B
Vue
Raw Normal View History

2018-06-27 14:38:27 +00:00
<script>
import Base from './Base';
export default {
extends: Base,
methods: {
getInputTag() {
return 'select';
},
getInputAttrs() {
return {
id: this.id,
2018-07-12 11:29:10 +00:00
required: this.docfield.required,
disabled: this.disabled
2018-06-27 14:38:27 +00:00
};
},
getInputChildren(h) {
return this.docfield.options.map(option =>
h('option', {
attrs: {
key: option,
selected: option === this.value
},
domProps: {
textContent: option
}
})
);
}
}
}
</script>