@opentiny/vue-docs 3.21.2 → 3.21.3

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.
@@ -43,16 +43,13 @@ npm install @opentiny/vue@3
43
43
  Then modify the`vite.config.js`, add the following code highlighted section:
44
44
 
45
45
  ```js {8-10}
46
- //vite.config.js
46
+ // vite.config.js
47
47
 
48
48
  import { defineConfig } from 'vite'
49
49
  import vue from '@vitejs/plugin-vue'
50
50
 
51
51
  export default defineConfig({
52
- plugins: [vue()],
53
- define: {
54
- 'process.env': { ...process.env }
55
- }
52
+ plugins: [vue()]
56
53
  })
57
54
  ```
58
55
 
@@ -49,10 +49,7 @@ import { defineConfig } from 'vite'
49
49
  import vue from '@vitejs/plugin-vue'
50
50
 
51
51
  export default defineConfig({
52
- plugins: [vue()],
53
- define: {
54
- 'process.env': { ...process.env }
55
- }
52
+ plugins: [vue()]
56
53
  })
57
54
  ```
58
55
 
@@ -40,10 +40,7 @@ import { defineConfig } from 'vite'
40
40
  import vue from '@vitejs/plugin-vue'
41
41
 
42
42
  export default defineConfig({
43
- plugins: [vue()],
44
- define: {
45
- 'process.env': { ...process.env }
46
- }
43
+ plugins: [vue()]
47
44
  })
48
45
  ```
49
46
 
@@ -40,10 +40,7 @@ import { defineConfig } from 'vite'
40
40
  import vue from '@vitejs/plugin-vue'
41
41
 
42
42
  export default defineConfig({
43
- plugins: [vue()],
44
- define: {
45
- 'process.env': { ...process.env }
46
- }
43
+ plugins: [vue()]
47
44
  })
48
45
  ```
49
46
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentiny/vue-docs",
3
- "version": "3.21.2",
3
+ "version": "3.21.3",
4
4
  "license": "MIT",
5
5
  "dependencies": {
6
6
  "@docsearch/css": "^3.8.0",
@@ -19,20 +19,20 @@
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",
22
23
  "@opentiny/vue": "~3.21.2",
23
24
  "@opentiny/vue-design-aurora": "~3.21.0",
24
- "@opentiny/vue-common": "~3.21.0",
25
25
  "@opentiny/vue-design-saas": "~3.21.0",
26
- "@opentiny/vue-directive": "~3.21.0",
27
- "@opentiny/vue-icon": "~3.21.0",
28
26
  "@opentiny/vue-design-smb": "~3.21.0",
29
27
  "@opentiny/vue-hooks": "~3.21.0",
28
+ "@opentiny/vue-icon": "~3.21.0",
29
+ "@opentiny/vue-directive": "~3.21.0",
30
30
  "@opentiny/vue-icon-multicolor": "~3.21.0",
31
- "@opentiny/vue-theme": "~3.21.0",
31
+ "@opentiny/vue-theme-mobile": "~3.21.0",
32
32
  "@opentiny/vue-icon-saas": "~3.21.0",
33
+ "@opentiny/vue-theme": "~3.21.2",
33
34
  "@opentiny/vue-theme-saas": "~3.21.0",
34
- "@opentiny/vue-vite-import": "~1.2.0",
35
- "@opentiny/vue-theme-mobile": "~3.21.0"
35
+ "@opentiny/vue-vite-import": "~1.2.0"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@playwright/test": "~1.49.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-internal/unplugin-virtual-template": "~0.1.1-beta.0",
75
- "@opentiny/vue-mobile": "~3.21.0"
74
+ "@opentiny/vue-mobile": "~3.21.0",
75
+ "@opentiny-internal/unplugin-virtual-template": "~0.1.1-beta.0"
76
76
  },
77
77
  "scripts": {
78
78
  "start": "vite",
@@ -1,5 +1,24 @@
1
1
  <template>
2
2
  <div class="ti-f-r ti-pt48 ti-pl48 ti-pr48 docs-container">
3
+ <tiny-modal v-model="showModal" title="请注意" status="warning" show-footer>
4
+ <div class="modal-body">
5
+ TinyVue 从 <span class="modal-body-keyword">3.13.0</span> 开始不需要在
6
+ <span class="modal-body-keyword">vite.config.js</span> 文件中配置
7
+ <span class="modal-body-keyword">define: { 'process.env': { ...process.env } }</span>
8
+ 这段代码,这段代码会导致环境变量被打包到构建产物中,引起信息安全风险,请业务尽快升级到
9
+ <span class="modal-body-keyword">3.13.0</span> 或以上版本!如果不升级版本可以改成:<span
10
+ class="modal-body-keyword"
11
+ >define: { 'process.env': { }}</span
12
+ >
13
+ 同样也可以解决此问题!感谢您对 TinyVue 的支持!
14
+ </div>
15
+ <template #footer>
16
+ <tiny-button type="primary" :disabled="disabled" @click="handleConfirm">{{
17
+ disabled ? `${time} S后可关闭此提示` : '确认将不再弹出此提示'
18
+ }}</tiny-button>
19
+ <tiny-button @click="handleCancel">取消</tiny-button>
20
+ </template>
21
+ </tiny-modal>
3
22
  <component id="doc_wrap" :is="docCmp" class="ti-w0 ti-fi-1" />
4
23
  <!-- 目录列表 TODO: 需要锚点组件配置整改,处理id中的特殊字符 -->
5
24
  <!-- <div v-if="anchorLinks.length > 0" class="docs-page-anchor catalog w128 sticky top32 ml24">
@@ -11,10 +30,33 @@
11
30
 
12
31
  <script setup>
13
32
  import { ref, nextTick, watch, onMounted, shallowRef } from 'vue'
33
+ import { Modal as TinyModal, Button as TinyButton } from '@opentiny/vue'
14
34
  import { getWord } from '@/tools'
15
35
  import docMDs from './docConfig.js'
16
36
  import { router } from '@/router.js'
17
37
 
38
+ const tipFlag = localStorage.getItem('tiny-vue-env-tip')
39
+ const showModal = ref(tipFlag !== 'never')
40
+ const disabled = ref(true)
41
+ let time = ref(5)
42
+ if (showModal.value) {
43
+ let timer = setInterval(() => {
44
+ if (time.value > 0) {
45
+ time.value = time.value - 1
46
+ } else {
47
+ disabled.value = false
48
+ clearInterval(timer)
49
+ timer = null
50
+ }
51
+ }, 1000)
52
+ }
53
+ const handleConfirm = () => {
54
+ showModal.value = false
55
+ localStorage.setItem('tiny-vue-env-tip', 'never')
56
+ }
57
+ const handleCancel = () => {
58
+ showModal.value = false
59
+ }
18
60
  const isOpen = import.meta.env.VITE_BUILD_TARGET === 'open'
19
61
  const openDocMap = {
20
62
  'envpreparation': 'envpreparation-open'
@@ -54,6 +96,9 @@ onMounted(() => {
54
96
  </script>
55
97
 
56
98
  <style lang="less">
99
+ .modal-body .modal-body-keyword {
100
+ color: var(--tv-base-color-error-6);
101
+ }
57
102
  .docs-container {
58
103
  flex: 1;
59
104
  display: flex;