Skip to content

Commit 8952045

Browse files
authored
fix(docs): 文档修改 (#3118)
1 parent 489a242 commit 8952045

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

examples/sites/demos/pc/webdoc/installation-en.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ yarn add @opentiny/vue@2
3131
npm install @opentiny/vue@2
3232
```
3333

34-
If it's`Vite`After the dependency is installed, modify the project.`vite.config.js`, add the following code highlighted section:
34+
<code>@opentiny/vue</code>Supports multiple modes. If you are a `Vite` project and not a mobile client, you can modify the `vite.config.js` of the project by adding the highlighted parts of the following code, so that the project can shake off the mobile mode code during construction and optimize the volume of the packaged product:
3535

3636
```js {8-10}
3737
// vite.config.js
@@ -40,14 +40,16 @@ import { defineConfig } from 'vite'
4040
import vue from '@vitejs/plugin-vue'
4141

4242
export default defineConfig({
43-
plugins: [vue()]
43+
plugins: [vue()],
44+
define: {
45+
'process.env': { TINY_MODE: 'pc' }
46+
}
4447
})
4548
```
4649

4750
<div class="tip custom-block">
48-
<p> To avoid the uncertainty associated with monthly (minor) upgrades of <code> @opentiny/vue </code>, it is recommended to use ~ before relying on the version number of the package in <code> package.json </code> in your project.
49-
For example, <code>"@opentiny/vue": "~3.12.0</code>. </p>
50-
<p><code> @opentiny/vue </code> supports multiple modes. If your project is not a mobile project, you can declare the value of <code>TINY_MODE</code> in <code>process.env</code> in the above configuration code. In order to make the project during construction, the mobile side code can be shaken off and the volume of the packaged product can be optimized. For example, <code>'process.env': {... env,TINY_MODE:'pc'}</code>. </p>
51+
<p>To avoid the uncertainty caused by monthly minor upgrades of<code>@opentiny/vue</code>, it is recommended to use ~ before the version number of the dependent package in <code>package.json</code> in your project,
52+
For example,<code>"@opentiny/vue": "~3.12.0"</code>.</p>
5153
</div>
5254

5355
## Import through CDN

examples/sites/demos/pc/webdoc/installation.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ yarn add @opentiny/vue@2
3131
npm install @opentiny/vue@2
3232
```
3333

34-
如果是`Vite` 工程,安装完依赖后,修改项目的 `vite.config.js` ,添加以下代码突出显示的部分:
34+
<code> @opentiny/vue </code> 支持多种模式。如果您是 `Vite` 工程且非移动端,可以修改项目的 `vite.config.js`,添加以下代码突出显示的部分,以使工程在构建时,能将移动端模式的代码摇掉,优化打包产物的体积
3535

3636
```js {8-10}
3737
// vite.config.js
@@ -40,14 +40,16 @@ import { defineConfig } from 'vite'
4040
import vue from '@vitejs/plugin-vue'
4141

4242
export default defineConfig({
43-
plugins: [vue()]
43+
plugins: [vue()],
44+
define: {
45+
'process.env': { TINY_MODE: 'pc' }
46+
}
4447
})
4548
```
4649

4750
<div class="tip custom-block">
4851
<p>为了避免<code> @opentiny/vue </code> 的月度版本 (minor) 升级带来的不确定因素,因此推荐在您的工程中的<code> package.json </code> 中依赖包的版本号前使用 ~,
49-
比如 <code>"@opentiny/vue": "~3.12.0</code>。</p>
50-
<p><code> @opentiny/vue </code> 支持多种模式。如果您的工程非移动端工程,可以在上面配置代码中的<code>process.env</code>中,声明<code>TINY_MODE</code>的值,以使工程在构建时,能将移动端模式的代码摇掉,优化打包产物的体积。比如 <code>'process.env': { ...process.env,TINY_MODE:'pc' }</code>。</p>
52+
比如 <code>"@opentiny/vue": "~3.12.0"</code>。</p>
5153
</div>
5254

5355
## 通过 CDN 方式引入 (v3.16.0 及之前的版本可用)

0 commit comments

Comments
 (0)