pagekit / vue-resource

The HTTP client for Vue.js
MIT License
10.08k stars 1.6k forks source link

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

Open GDUTxxZ opened 5 years ago

GDUTxxZ commented 5 years ago

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

protogenesis commented 5 years ago

I think so, thanks.

ghost commented 4 years ago

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.