@opentiny/vue-docs 2.0.1 → 2.0.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.
@@ -7,3 +7,4 @@ import { ref } from 'vue'
7
7
  import { UserLink as TinyUserLink } from '@opentiny/vue'
8
8
 
9
9
  const user = ref('441047913162396,421000103624183')
10
+ </script>
package/index.html CHANGED
@@ -21,7 +21,7 @@
21
21
 
22
22
  <script
23
23
  id="tinyui-design-common"
24
- src="https://test-static-resource.obs.cn-north-7.ulanqab.huawei.com/tinyui-design-common/1.0.5.20230714174408/tinyui-design-common.min.js"
24
+ src="https://res.hc-cdn.com/tinyui-design-common/1.0.5.20230707170109/tinyui-design-common.min.js"
25
25
  ></script>
26
26
  <script type="module" src="./src/main.js"></script>
27
27
  </body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentiny/vue-docs",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "dependencies": {
5
5
  "@unocss/reset": "0.38.2",
6
6
  "@vue/repl": "^2.5.5",
@@ -18,13 +18,13 @@
18
18
  "@opentiny/vue-repl": "^1.0.2",
19
19
  "@opentiny/vue": "~3.10.0",
20
20
  "@opentiny/vue-common": "~3.10.0",
21
- "@opentiny/vue-icon": "~3.10.0",
22
21
  "@opentiny/vue-design-aurora": "~3.10.0",
22
+ "@opentiny/vue-icon": "~3.10.0",
23
23
  "@opentiny/vue-design-smb": "~3.10.0",
24
- "@opentiny/vue-theme": "~3.10.0",
25
- "@opentiny/vue-theme-saas": "~3.10.0",
26
24
  "@opentiny/vue-vite-import": "~1.1.5",
27
- "@opentiny/vue-theme-mobile": "~3.10.0"
25
+ "@opentiny/vue-theme": "~3.10.0",
26
+ "@opentiny/vue-theme-mobile": "~3.10.0",
27
+ "@opentiny/vue-theme-saas": "~3.10.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/markdown-it": "^12.2.3",
package/src/App.vue CHANGED
@@ -1,16 +1,23 @@
1
1
  <template>
2
2
  <div class="hp100 of-hidden">
3
- <router-view />
3
+ <tiny-config-provider :design="designConfig">
4
+ <router-view />
5
+ </tiny-config-provider>
4
6
  </div>
5
7
  </template>
6
8
 
7
9
  <script lang="jsx">
8
10
  import { defineComponent, reactive, computed, onMounted, toRefs } from 'vue'
11
+ import { ConfigProvider } from '@opentiny/vue'
9
12
  import { appData } from './tools'
13
+ import useTheme from './tools/useTheme'
10
14
 
11
15
  export default defineComponent({
12
16
  name: 'AppVue',
13
17
  props: [],
18
+ components: {
19
+ TinyConfigProvider: ConfigProvider
20
+ },
14
21
  setup() {
15
22
  onMounted(() => {
16
23
  // 加载header
@@ -25,8 +32,10 @@ export default defineComponent({
25
32
  })
26
33
  common.renderHeader()
27
34
  })
35
+ const { designConfig } = useTheme()
28
36
  return {
29
- appData
37
+ appData,
38
+ designConfig
30
39
  }
31
40
  }
32
41
  })
@@ -1,8 +1,10 @@
1
- import { watch } from 'vue'
1
+ import { watch, computed } from 'vue'
2
2
  import TinyThemeTool from '@opentiny/vue-theme/theme-tool'
3
3
  import { tinyAuroraTheme, tinySmbTheme, tinyInfinityTheme } from '@opentiny/vue-theme/theme'
4
4
  import { hooks } from '@opentiny/vue-common'
5
5
  import { Notify } from '@opentiny/vue'
6
+ import designSmbConfig from '@opentiny/vue-design-smb';
7
+ import designAuroraConfig from '@opentiny/vue-design-aurora';
6
8
  import { appData } from './appData'
7
9
 
8
10
  const CURRENT_THEME_KEY = 'tiny-current-theme'
@@ -16,6 +18,12 @@ const themeData = [
16
18
  { value: 'tiny-smb-theme', label: isEn ? 'SMB Theme' : 'SMB 主题' }
17
19
  ]
18
20
 
21
+ const designConfigMap = {
22
+ 'tiny-default-theme': {},
23
+ 'tiny-infinity-theme': {},
24
+ 'tiny-aurora-theme': designAuroraConfig,
25
+ 'tiny-smb-theme': designSmbConfig
26
+ }
19
27
  let isShowTip = false
20
28
  function showTip() {
21
29
  Notify({
@@ -33,6 +41,9 @@ export default function useTheme() {
33
41
  const theme = new TinyThemeTool()
34
42
  const lastThemeKey = localStorage.getItem(CURRENT_THEME_KEY)
35
43
  const currThemeLabel = hooks.ref(lastThemeKey || 'tiny-default-theme')
44
+ const designConfig = computed(() => {
45
+ return designConfigMap[currThemeLabel.value]
46
+ })
36
47
 
37
48
  const THEME_MAP = {
38
49
  'tiny-aurora-theme': tinyAuroraTheme,
@@ -67,6 +78,7 @@ export default function useTheme() {
67
78
  return {
68
79
  getThemeData,
69
80
  changeTheme,
70
- currThemeLabel
81
+ currThemeLabel,
82
+ designConfig
71
83
  }
72
84
  }
@@ -324,6 +324,7 @@ export default defineComponent({
324
324
  text-align: left;
325
325
  font-size: 14px;
326
326
  line-height: 1.5;
327
+ word-break: break-word;
327
328
  }
328
329
  td {
329
330
  font-size: 14px;