import { use } from '../utils'; import Button from '../button'; const [sfc, bem, t] = use('submit-bar'); export default sfc({ props: { tip: String, label: String, loading: Boolean, disabled: Boolean, buttonText: String, price: { type: Number, default: null }, currency: { type: String, default: '¥' }, buttonType: { type: String, default: 'danger' } }, render(h) { const { tip, price, $slots } = this; const hasPrice = typeof price === 'number'; return (
{$slots.top} {($slots.tip || tip) && (
{tip} {$slots.tip}
)}
{$slots.default}
{hasPrice && [ {this.label || t('label')}, {`${this.currency} ${(price / 100).toFixed(2)}`} ]}
); } });