2
0
mirror of https://github.com/frappe/books.git synced 2024-12-23 11:29:03 +00:00

Add Int control

This commit is contained in:
Faris Ansari 2018-06-25 16:48:07 +05:30
parent 8d8b75bce8
commit a05858277d
2 changed files with 19 additions and 2 deletions

View File

@ -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];
}
}

View 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>