diff --git a/src/submit-bar/index.js b/src/submit-bar/index.tsx similarity index 89% rename from src/submit-bar/index.js rename to src/submit-bar/index.tsx index 9cdf66e67..966053125 100644 --- a/src/submit-bar/index.js +++ b/src/submit-bar/index.tsx @@ -1,6 +1,9 @@ +import { PropType, CSSProperties } from 'vue'; import { createNamespace } from '../utils'; + +// Components import Icon from '../icon'; -import Button from '../button'; +import Button, { ButtonType } from '../button'; const [createComponent, bem, t] = createNamespace('submit-bar'); @@ -12,7 +15,7 @@ export default createComponent({ tipIcon: String, loading: Boolean, disabled: Boolean, - textAlign: String, + textAlign: String as PropType, buttonText: String, buttonColor: String, suffixLabel: String, @@ -29,7 +32,7 @@ export default createComponent({ default: '¥', }, buttonType: { - type: String, + type: String as PropType, default: 'danger', }, }, @@ -48,7 +51,7 @@ export default createComponent({ } = props; if (typeof price === 'number') { - const pricePair = (price / 100).toFixed(decimalLength).split('.'); + const pricePair = (price / 100).toFixed(+decimalLength).split('.'); const decimal = decimalLength ? `.${pricePair[1]}` : ''; return (