NutUI 3.0 按需加载使用方式 #727
Unanswered
richard1015
asked this question in
Q&A
Replies: 1 comment
-
这样按需加载很多组件还是无法正常渲染,譬如 https://nutui.jd.com/3x/#/imagepreview ,这个图片swiper组件等等,希望能尽快给出完整解决方案 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Vite 构建工具 通过 vite-plugin 使用按需加载
Vite 构建工具,使用 vite-plugin-style-import 实现按需引入。
安装插件
在
vite.config
中添加配置:WebPack 构建工具 通过 babel 使用按需加载
babel-plugin-import 是一款 babel 插件,它会在编译过程中将 import 语句自动转换为按需引入的方式。
安装插件
在
.babelrc
或babel.config.js
中添加配置:接着像这样在代码中直接引入组件。
Beta Was this translation helpful? Give feedback.
All reactions