@opentiny/vue-docs 3.21.3 → 3.21.4
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.
|
@@ -31,7 +31,7 @@ yarn add @opentiny/vue@2
|
|
|
31
31
|
npm install @opentiny/vue@2
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
If
|
|
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:
|
|
35
35
|
|
|
36
36
|
```js {8-10}
|
|
37
37
|
// vite.config.js
|
|
@@ -40,14 +40,16 @@ import { defineConfig } from 'vite'
|
|
|
40
40
|
import vue from '@vitejs/plugin-vue'
|
|
41
41
|
|
|
42
42
|
export default defineConfig({
|
|
43
|
-
plugins: [vue()]
|
|
43
|
+
plugins: [vue()],
|
|
44
|
+
define: {
|
|
45
|
+
'process.env': { TINY_MODE: 'pc' }
|
|
46
|
+
}
|
|
44
47
|
})
|
|
45
48
|
```
|
|
46
49
|
|
|
47
50
|
<div class="tip custom-block">
|
|
48
|
-
<p>
|
|
49
|
-
For example
|
|
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>
|
|
51
53
|
</div>
|
|
52
54
|
|
|
53
55
|
## Import through CDN
|
|
@@ -31,7 +31,7 @@ yarn add @opentiny/vue@2
|
|
|
31
31
|
npm install @opentiny/vue@2
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
<code> @opentiny/vue </code> 支持多种模式。如果您是 `Vite` 工程且非移动端,可以修改项目的 `vite.config.js`,添加以下代码突出显示的部分,以使工程在构建时,能将移动端模式的代码摇掉,优化打包产物的体积:
|
|
35
35
|
|
|
36
36
|
```js {8-10}
|
|
37
37
|
// vite.config.js
|
|
@@ -40,14 +40,16 @@ import { defineConfig } from 'vite'
|
|
|
40
40
|
import vue from '@vitejs/plugin-vue'
|
|
41
41
|
|
|
42
42
|
export default defineConfig({
|
|
43
|
-
plugins: [vue()]
|
|
43
|
+
plugins: [vue()],
|
|
44
|
+
define: {
|
|
45
|
+
'process.env': { TINY_MODE: 'pc' }
|
|
46
|
+
}
|
|
44
47
|
})
|
|
45
48
|
```
|
|
46
49
|
|
|
47
50
|
<div class="tip custom-block">
|
|
48
51
|
<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>
|
|
51
53
|
</div>
|
|
52
54
|
|
|
53
55
|
## 通过 CDN 方式引入 (v3.16.0 及之前的版本可用)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/vue-docs",
|
|
3
|
-
"version": "3.21.
|
|
3
|
+
"version": "3.21.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@docsearch/css": "^3.8.0",
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
"vue": "^3.4.31",
|
|
20
20
|
"vue-i18n": "^9.1.10",
|
|
21
21
|
"vue-router": "4.1.5",
|
|
22
|
-
"@opentiny/vue-common": "~3.21.0",
|
|
23
22
|
"@opentiny/vue": "~3.21.2",
|
|
23
|
+
"@opentiny/vue-design-smb": "~3.21.0",
|
|
24
24
|
"@opentiny/vue-design-aurora": "~3.21.0",
|
|
25
25
|
"@opentiny/vue-design-saas": "~3.21.0",
|
|
26
|
-
"@opentiny/vue-design-smb": "~3.21.0",
|
|
27
26
|
"@opentiny/vue-hooks": "~3.21.0",
|
|
28
27
|
"@opentiny/vue-icon": "~3.21.0",
|
|
29
28
|
"@opentiny/vue-directive": "~3.21.0",
|
|
29
|
+
"@opentiny/vue-common": "~3.21.0",
|
|
30
30
|
"@opentiny/vue-icon-multicolor": "~3.21.0",
|
|
31
31
|
"@opentiny/vue-theme-mobile": "~3.21.0",
|
|
32
32
|
"@opentiny/vue-icon-saas": "~3.21.0",
|
|
@@ -71,8 +71,8 @@
|
|
|
71
71
|
"vite-plugin-static-copy": "^0.17.0",
|
|
72
72
|
"vite-svg-loader": "^3.6.0",
|
|
73
73
|
"vue-tsc": "^1.8.5",
|
|
74
|
-
"@opentiny/
|
|
75
|
-
"@opentiny
|
|
74
|
+
"@opentiny-internal/unplugin-virtual-template": "~0.1.1-beta.0",
|
|
75
|
+
"@opentiny/vue-mobile": "~3.21.0"
|
|
76
76
|
},
|
|
77
77
|
"scripts": {
|
|
78
78
|
"start": "vite",
|