2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 15:50:56 +00:00
books/ui/components/controls/FrappeControl.vue
2018-06-27 20:08:27 +05:30

51 lines
1.2 KiB
Vue

<template>
<component :is="component"
:docfield="docfield"
:value="value"
:onlyInput="onlyInput"
@change="$emit('change', $event)"
/>
</template>
<script>
import Autocomplete from './Autocomplete';
import Check from './Check';
import Code from './Code';
import Currency from './Currency';
import Data from './Data';
import Date from './Date';
import DynamicLink from './DynamicLink';
import File from './File';
import Float from './Float';
import Int from './Int';
import Link from './Link';
import Password from './Password';
import Select from './Select';
import Table from './Table';
import Text from './Text';
export default {
props: ['docfield', 'value', 'onlyInput'],
computed: {
component() {
return {
Autocomplete,
Check,
Code,
Currency,
Data,
Date,
DynamicLink,
File,
Float,
Int,
Link,
Password,
Select,
Table,
Text,
}[this.docfield.fieldtype];
}
}
}
</script>