@alls-to/vue
v0.0.6
Published
## 安装SDK ``` yarn add ``` ## Demo 代码
Downloads
5
Readme
alls-to-vue
安装SDK
yarn add
Demo 代码
<!-- App.vue -->
<template>
<div>
<PaymentButton :onCompleted="onCompleted" :option="option" :host="host" />
</div>
</template>
<script lang="ts">
import { defineComponent, ref } from 'vue'
import PaymentButton from '@alls-to/vue'
export default defineComponent({
name: 'App-Demo',
methods: {},
components: {
PaymentButton,
},
setup(props) {
// 交易完成回调函数
function onCompleted(e: any) {
console.log('Payment completed!', e)
}
const option = {
customer: '',
id: 'allsto-demo/product1',
method: 'crypto,fiat',
}
const host = `https://gateway.alls.to/checkout`
return { onCompleted, option, host }
},
})
</script>
<style>
#app {
text-align: center;
margin-top: 60px;
}
</style>