Your IP : 216.73.216.86


Current Path : /var/www/homesaver/www/bitrix/js/sale/checkout/view/element/button/checkout/src/
Upload File :
Current File : /var/www/homesaver/www/bitrix/js/sale/checkout/view/element/button/checkout/src/checkout.js

import {Vue} from 'ui.vue';
import {Event} from 'main.core'
import {EventType} from 'sale.checkout.const';
import './checkout.css'

Vue.component('sale-checkout-view-element-button-checkout', {
	props: ['title', 'wait'],
	methods:
		{
			checkout()
			{
				Event.EventEmitter.emit(EventType.element.buttonCheckout);
			}
		},
	computed:
		{
			getObjectClass()
			{
				const classes = [
					'btn',
					'btn-primary',
					'product-item-buy-button',
					'rounded-pill'
				];

				if(this.wait)
				{
					classes.push('btn-wait')
				}
				return classes;
			}
		},
	// language=Vue
	template: `
		<div class="checkout-btn-container" @click="checkout">
			<button :class="getObjectClass" >{{title}}</button>
		</div>
	`
});