Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

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

Open
GDUTxxZ opened this issue Nov 28, 2018 · 2 comments
Open

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

GDUTxxZ opened this issue Nov 28, 2018 · 2 comments

Comments

@GDUTxxZ
Copy link

GDUTxxZ commented Nov 28, 2018

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
Copy link

I think so, thanks.

@ghost
Copy link

ghost commented Dec 9, 2019

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants