mirror of
https://github.com/frappe/books.git
synced 2024-11-10 07:40:55 +00:00
Add Int control
This commit is contained in:
parent
8d8b75bce8
commit
a05858277d
@ -13,13 +13,15 @@ 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';
|
||||
import DynamicLink from './DynamicLink';
|
||||
|
||||
export default {
|
||||
props: ['docfield', 'value', 'onlyInput'],
|
||||
@ -32,13 +34,15 @@ export default {
|
||||
Currency,
|
||||
Data,
|
||||
Date,
|
||||
DynamicLink,
|
||||
File,
|
||||
Float,
|
||||
Int,
|
||||
Link,
|
||||
Password,
|
||||
Select,
|
||||
Table,
|
||||
Text,
|
||||
DynamicLink,
|
||||
}[this.docfield.fieldtype];
|
||||
}
|
||||
}
|
||||
|
13
src/components/controls/Int.vue
Normal file
13
src/components/controls/Int.vue
Normal file
@ -0,0 +1,13 @@
|
||||
<script>
|
||||
import Float from './Float';
|
||||
|
||||
export default {
|
||||
extends: Float,
|
||||
methods: {
|
||||
parse(value) {
|
||||
const parsedValue = parseInt(value);
|
||||
return isNaN(parsedValue) ? 0 : parsedValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user