Nov 6, 2017
0
Level 2
How to use Base Spark Components in Custom Vue Components?
Here is the code of my Custom Vue Component.
var base = require('settings/subscription/subscribe-braintree');
Vue.component('subscribe', {
mixins: [base],
/**
* The component's data.
*/
data() {
return {
plan: ''
}
}
});
I am using a Base Spark Component. But I am getting some error with a component used in the mixin of the base spark component. Where am I doing it wrong?
Here is the code of settings/subscription/subscribe-braintree
...
mixins: [
require('./../../mixins/braintree'),
require('./../../mixins/plans'),
require('./../../mixins/subscriptions')
],
...
this.braintree('braintree-subscribe-container', response => {
this.form.braintree_type = response.type;
this.form.braintree_token = response.nonce;
this.subscribe();
});
...
I am getting the following error:
[Vue warn]: Error in mounted hook: "ReferenceError: braintree is not defined"
Please or to participate in this conversation.