@sepveneto/plugin-mp-router-view 0.3.5 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  ## 限制
6
6
  只能写在`App.vue`中,有且只能有一个`<router-view />`。
7
7
 
8
- 不需要根标签。
8
+ 与常规`vue2`的写法类似,`App.vue`中只允许存在一个根节点。
9
9
 
10
10
  ## 快速开始
11
11
 
@@ -18,6 +18,25 @@ pnpm i @sepveneto/plugin-mp-router-view
18
18
 
19
19
  ### 使用
20
20
 
21
+ <details>
22
+ <summary>UniApp v2</summary><br>
23
+
24
+ ```js
25
+ module.exports = {
26
+ chainWebpack: config => {
27
+ config.module
28
+ .rule('vue')
29
+ .use('@sepveneto/plugin-mp-router-view/loader')
30
+ .loader('@sepveneto/plugin-mp-router-view/loader')
31
+ .options({ /* options */ })
32
+ .end()
33
+ }
34
+ }
35
+ ```
36
+ #### 为什么
37
+ 虽然uniapp的v2版本是依赖`webpack4/5`进行构建,但是通过`plugins`注入的代码无法影响到uniapp的编译结果。因此参考[uniapp-router-view-loader](https://github.com/2460392754/uniapp-router-view-loader)使用loader来实现vue2版本的代码注入。
38
+ <br></details>
39
+
21
40
  <details>
22
41
  <summary>Vite</summary><br>
23
42