Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[文档]unplugin-vue-components@0.26.0 引用方式有误 #12499

Closed
weiliang-Zhang opened this issue Dec 11, 2023 · 2 comments
Closed

[文档]unplugin-vue-components@0.26.0 引用方式有误 #12499

weiliang-Zhang opened this issue Dec 11, 2023 · 2 comments

Comments

@weiliang-Zhang
Copy link

重现链接

https://github.com/youzan/vant/blob/main/packages/vant/docs/markdown/quickstart.zh-CN.md

Vant 版本

4.8.0

描述一下你遇到的问题。

对于 unplugin-vue-components@0.26.0,在基于 vue-cli 和基于 webpack 的配置中,unplugin-vue-components 的引入方式有误。

  • 文档中的引入方式为:const ComponentsPlugin = require('unplugin-vue-components/webpack');
  • 运行时会报错:ComponentsPlugin is not a function
  • 正确的引入方式为 const ComponentsPlugin = require('unplugin-vue-components/webpack').default();

unplugin-vue-components@0.26.0 官方文档中的引用方式为:

// webpack.config.js
module.exports = {
  /* ... */
  plugins: [
    require('unplugin-vue-components/webpack').default({ /* options */ }),
  ],
}

重现步骤

查看 vant@4 官方文档:https://vant-contrib.gitee.io/vant/#/zh-CN/quickstart#2.-pei-zhi-cha-jian

设备/浏览器

No response

@wChenonly
Copy link
Contributor

Because of this Breaking Changes

@chenjiahan Do we need to note the instructions of greater than 0.26.0 and less than 0.26.0 respectively in the document?

@chenjiahan
Copy link
Member

chenjiahan commented Dec 12, 2023

That would be nice, PR welcome~

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

No branches or pull requests

3 participants