| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- import { VantComponent } from '../common/component';
- import { iphonex } from '../mixins/iphonex';
- VantComponent({
- mixins: [iphonex],
- classes: ['bar-class', 'price-class', 'button-class'],
- props: {
- tip: null,
- type: Number,
- price: null,
- label: String,
- loading: Boolean,
- disabled: Boolean,
- buttonText: String,
- currency: {
- type: String,
- value: '¥'
- },
- buttonType: {
- type: String,
- value: 'danger'
- }
- },
- computed: {
- hasPrice: function hasPrice() {
- return typeof this.data.price === 'number';
- },
- priceStr: function priceStr() {
- return (this.data.price / 100).toFixed(2);
- },
- tipStr: function tipStr() {
- var tip = this.data.tip;
- return typeof tip === 'string' ? tip : '';
- }
- },
- methods: {
- onSubmit: function onSubmit(event) {
- this.$emit('submit', event.detail);
- }
- }
- });
|