pagekit / vue-resource

The HTTP client for Vue.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

there is a mistake in docs about how to import the module

GDUTxxZ opened this issue · comments

commented

the example in docs about how to import the module:

Vue.use(require('vue-resource'))

but in source code, the moudle export like:

export default plugin

so actually we should use the module like:

Vue.use(require('vue-resource').default)

What is Expected?

May be the docs should be updated?
docs

I think so, thanks.

Not really, export default statement is used with the value that we want to be imported by default when someone else requires out module. So when we use require('vue-resource') expression, the default export from the module vue-resourse will be returned - plugin function.