@brjohnson4 You should be able to use a Vue plugin just as you would with any Laravel app. Remember, you have to require the plugin before the Vue instance is created. You are declaring it after.
Dec 29, 2016
6
Level 5
Spark and Vue Plugins
How do I install and use a Vue Plugin with Spark?
More specifically, I'm trying to use the vue-clipboard plugin found here: https://github.com/xiaokaike/vue-clipboard
I have done "npm install vue-clipboard" in my terminal window. My app.js file looks like this:
require('spark-bootstrap');
require('./components/bootstrap');
var app = new Vue({
mixins: [require('spark')]
});
var VueClipboard = require('vue-clipboard');
Vue.use(VueClipboard);
Then I have a vue component like this:
Vue.component('copy-to-clipboard', {
data: function() {
return {
copyData: 'copy data'
}
},
template: '<button v-clipboard:copy="copyData">Copy</button>'
});
And then I have <copy-to-clipboard></copy-to-clipboard> in my view. But I get an error message: Failed to resolve directive: clipboard (found in component <copy-to-clipboard>)
What am I doing wrong? Thanks!
Please or to participate in this conversation.