-
Notifications
You must be signed in to change notification settings - Fork 1.6k
How do you use this with Browserify/require? #11
Comments
Just But you do need to install it explicitly: Vue.use(require('vue-resource')) |
I am also struggling with this...
I have also tried In the first case I get a |
Ahh, I just noticed this package is not on npm. I'll publish it if that's ok with you, @steffans . @jlem @slickorange in Browserify the |
Update: it's now on npm. Just |
Still not working... var Vue = require('./vue.js');
require('vue-resource');
new Vue({
el: '#app',
components: {
//searchcard: require('./components/search-card')
//quoteitems: require('./components/quote-items')
},
methods: {
test: function(){
console.log('test');
this.$http.post('/search/',
{'test' : 'test'})
}
}
}); |
Ah. When you load it in CommonJS, it doesn't auto-install itself. You need to install it: var Vue = require('vue')
var Resource = require('vue-resource')
Vue.use(Resource) |
Thanks for the insanely quick help :) That did the trick... |
Here's some info on the plugin interface: http://vuejs.org/guide/extending.html#Extend_with_Plugins vue-resource auto-installs itself only when it finds a global |
work, thanks |
Still if you are having issue with browserify + vuejs and if
not working then use
in package.json
then in js file simple call
2nd alternative is (without aliasify) - just use
it should work! |
As titled. Not sure how to use this with browserify. I've installed via npm pointing to this repo, and it's in node_modules, but I'm not sure what to
require()
The text was updated successfully, but these errors were encountered: