vue中集成的ui组件库
Vue Braintree PayPal按钮 (Vue Braintree PayPal button)
Vue component to integrate PayPal payments through Braintree using Vault flow.
Vue组件可使用Vault Flow通过Braintree集成PayPal付款。
安装 (Installation)
纱 (Yarn)
yarn add @mrjeffapp/vue-braintree-paypal-button
NPM (NPM)
npm install --save @mrjeffapp/vue-braintree-paypal-button
用法 (Usage)
示例:TokenGenerator.vue (Example: TokenGenerator.vue)
<template>
<BraintreePaypalButton v-bind:styles="{ shape: 'rect' }" :token="token" :env="environment" :locale="locale" v-on:error="onError" v-on:authorized="onAuthorize" v-on:canceled="onCancel" />
</template>
<script>
import BraintreePaypalButton from '@/components/BraintreePaypalButton.vue';
export default {
name: 'TokenGenerator',
components: {
BraintreePaypalButton,
},
data() {
return {
environment: 'sandbox',
token: 'token',
locale: 'es_ES',
};
},
methods: {
onAuthorize: (nonce) => {
console.log(nonce);
},
onCancel: () => {
console.log('Cancelled');
},
onError: (error) => {
console.error(error);
},
},
};
</script>
<style>
</style>
组件道具 (Component props)
环保 (env)
Type:
String
类型:
String
Required:
true
必填:
true
Values:
production
|sandbox
价值:
production
sandbox
代币 (token)
Type:
String
类型:
String
Required:
false
必填:
false
地区 (locale)
Type:
String
类型:
String
Required:
false
必填:
false
Default:
en_US
默认值:
en_US
Values: Supported locales
值: 支持的语言环境
样式 (styles)
Type:
Object
类型:
Object
Required:
false
必填:
false
Default:
{}
默认值:
{}
Values: Customize button
值:“ 自定义”按钮
组件事件 (Component events)
授权 (authorize)
When customer authorize vault flow.
客户授权金库流程时。
取消 (cancel)
When customer cancel vault flow.
当客户取消保险库流程时。
错误 (error)
When an error occurs.
发生错误时。
发展 (Developing)
项目设置 (Project setup)
yarn install
编译和热重装以进行开发 (Compiles and hot-reloads for development)
yarn serve
编译并最小化生产 (Compiles and minifies for production)
yarn build
整理和修复文件 (Lints and fixes files)
yarn lint
运行单元测试 (Run unit tests)
yarn test:unit
运行en结束测试 (Run en to end tests)
yarn test:e2e
vue中集成的ui组件库