mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
types(SubmitBar): use tsx (#8081)
This commit is contained in:
parent
aeeeae8d2b
commit
c0c2e8e125
@ -1,6 +1,9 @@
|
|||||||
|
import { PropType, CSSProperties } from 'vue';
|
||||||
import { createNamespace } from '../utils';
|
import { createNamespace } from '../utils';
|
||||||
|
|
||||||
|
// Components
|
||||||
import Icon from '../icon';
|
import Icon from '../icon';
|
||||||
import Button from '../button';
|
import Button, { ButtonType } from '../button';
|
||||||
|
|
||||||
const [createComponent, bem, t] = createNamespace('submit-bar');
|
const [createComponent, bem, t] = createNamespace('submit-bar');
|
||||||
|
|
||||||
@ -12,7 +15,7 @@ export default createComponent({
|
|||||||
tipIcon: String,
|
tipIcon: String,
|
||||||
loading: Boolean,
|
loading: Boolean,
|
||||||
disabled: Boolean,
|
disabled: Boolean,
|
||||||
textAlign: String,
|
textAlign: String as PropType<CSSProperties['textAlign']>,
|
||||||
buttonText: String,
|
buttonText: String,
|
||||||
buttonColor: String,
|
buttonColor: String,
|
||||||
suffixLabel: String,
|
suffixLabel: String,
|
||||||
@ -29,7 +32,7 @@ export default createComponent({
|
|||||||
default: '¥',
|
default: '¥',
|
||||||
},
|
},
|
||||||
buttonType: {
|
buttonType: {
|
||||||
type: String,
|
type: String as PropType<ButtonType>,
|
||||||
default: 'danger',
|
default: 'danger',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -48,7 +51,7 @@ export default createComponent({
|
|||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
if (typeof price === 'number') {
|
if (typeof price === 'number') {
|
||||||
const pricePair = (price / 100).toFixed(decimalLength).split('.');
|
const pricePair = (price / 100).toFixed(+decimalLength).split('.');
|
||||||
const decimal = decimalLength ? `.${pricePair[1]}` : '';
|
const decimal = decimalLength ? `.${pricePair[1]}` : '';
|
||||||
|
|
||||||
return (
|
return (
|
Loading…
x
Reference in New Issue
Block a user