@varlet/cli 2.17.1 → 2.18.0-alpha.1697511280107

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/cli",
3
- "version": "2.17.1",
3
+ "version": "2.18.0-alpha.1697511280107",
4
4
  "type": "module",
5
5
  "description": "cli of varlet",
6
6
  "bin": {
@@ -64,8 +64,8 @@
64
64
  "vite": "4.3.5",
65
65
  "vue": "3.3.4",
66
66
  "webfont": "^9.0.0",
67
- "@varlet/shared": "2.17.1",
68
- "@varlet/vite-plugins": "2.17.1"
67
+ "@varlet/shared": "2.18.0-alpha.1697511280107",
68
+ "@varlet/vite-plugins": "2.18.0-alpha.1697511280107"
69
69
  },
70
70
  "devDependencies": {
71
71
  "@types/babel__core": "^7.20.1",
@@ -80,9 +80,9 @@
80
80
  "@types/semver": "^7.3.9",
81
81
  "@types/sharp": "0.31.1",
82
82
  "rimraf": "^5.0.1",
83
- "@varlet/ui": "2.17.1",
84
- "@varlet/icons": "2.17.1",
85
- "@varlet/touch-emulator": "2.17.1"
83
+ "@varlet/icons": "2.18.0-alpha.1697511280107",
84
+ "@varlet/ui": "2.18.0-alpha.1697511280107",
85
+ "@varlet/touch-emulator": "2.18.0-alpha.1697511280107"
86
86
  },
87
87
  "peerDependencies": {
88
88
  "@vue/runtime-core": "3.3.4",
@@ -95,9 +95,9 @@
95
95
  "lodash-es": "^4.17.21",
96
96
  "vue": "3.3.4",
97
97
  "vue-router": "4.2.0",
98
- "@varlet/ui": "2.17.1",
99
- "@varlet/icons": "2.17.1",
100
- "@varlet/touch-emulator": "2.17.1"
98
+ "@varlet/icons": "2.18.0-alpha.1697511280107",
99
+ "@varlet/ui": "2.18.0-alpha.1697511280107",
100
+ "@varlet/touch-emulator": "2.18.0-alpha.1697511280107"
101
101
  },
102
102
  "scripts": {
103
103
  "dev": "tsc --watch",
@@ -1,72 +1,57 @@
1
1
  <template>
2
2
  <div class="varlet-site-sidebar var-elevation--3">
3
- <var-cell
4
- class="varlet-site-sidebar__item"
5
- :id="item.doc"
6
- :class="{
7
- 'varlet-site-sidebar__item--active': item.doc === menuName,
8
- 'varlet-site-sidebar__link': item.type !== menuTypes.TITLE,
9
- 'varlet-site-sidebar__title': item.type === menuTypes.TITLE,
10
- }"
11
- :key="index"
3
+ <a
4
+ class="varlet-site-sidebar__link"
12
5
  v-for="(item, index) in menu"
13
- v-ripple="{
14
- disabled: item.type === menuTypes.TITLE,
15
- }"
16
- @click="changeRoute(item)"
6
+ :key="index"
7
+ :href="`#/${language}/${item.doc}`"
8
+ @click.prevent
17
9
  >
18
- <span class="varlet-site-sidebar__indicator"></span>
19
- <span class="varlet-site-sidebar__item--title" v-if="item.type === menuTypes.TITLE">{{ item.text[language]
10
+ <var-cell
11
+ class="varlet-site-sidebar__item"
12
+ :id="item.doc"
13
+ :class="{
14
+ 'varlet-site-sidebar__item--active': item.doc === menuName,
15
+ 'varlet-site-sidebar__cell': item.type !== menuTypes.TITLE,
16
+ 'varlet-site-sidebar__title': item.type === menuTypes.TITLE,
17
+ }"
18
+ v-ripple="{
19
+ disabled: item.type === menuTypes.TITLE,
20
+ }"
21
+ @click="changeRoute(item)"
22
+ >
23
+ <span class="varlet-site-sidebar__indicator"></span>
24
+ <span class="varlet-site-sidebar__item--title" v-if="item.type === menuTypes.TITLE">{{
25
+ item.text[language]
20
26
  }}</span>
21
- <span v-else>{{ item.text[language] }}</span>
22
- </var-cell>
27
+ <span v-else>{{ item.text[language] }}</span>
28
+ </var-cell>
29
+ </a>
23
30
  </div>
24
31
  </template>
25
32
 
26
- <script lang="ts">
33
+ <script setup lang="ts">
27
34
  import { MenuTypes, type Menu } from '../../utils'
28
- import { reactive, defineComponent } from 'vue'
29
- import type { PropType } from 'vue'
30
-
31
- export default defineComponent({
32
- name: 'AppSidebar',
33
- props: {
34
- menu: {
35
- type: Array as PropType<Menu[]>
36
- },
37
- menuName: {
38
- type: String
39
- },
40
- language: {
41
- type: String,
42
- default: ''
43
- }
44
- },
45
- emits: ['change'],
46
- setup(props, { emit }) {
47
- const menuTypes = reactive(MenuTypes)
48
-
49
- const changeRoute = (item: Menu) => {
50
- if (item.type === MenuTypes.TITLE || props.menuName === item.doc) {
51
- return
52
- }
35
+ import { reactive } from 'vue'
53
36
 
54
- emit('change', item)
55
- }
37
+ const props = defineProps<{ menu: Menu[]; menuName: string; language: string }>()
38
+ const emit = defineEmits(['change'])
39
+ const menuTypes = reactive(MenuTypes)
56
40
 
57
- return {
58
- menuTypes,
59
- changeRoute
60
- }
41
+ const changeRoute = (item: Menu) => {
42
+ if (item.type === MenuTypes.TITLE || props.menuName === item.doc) {
43
+ return
61
44
  }
62
- })
45
+
46
+ emit('change', item)
47
+ }
63
48
  </script>
64
49
 
65
50
  <style lang="less">
66
51
  @keyframes indicator-fade-in {
67
52
  from {
68
53
  transform: scaleY(0);
69
- opacity: .3;
54
+ opacity: 0.3;
70
55
  }
71
56
 
72
57
  to {
@@ -91,6 +76,13 @@ export default defineComponent({
91
76
  display: none;
92
77
  }
93
78
 
79
+ &__link {
80
+ display: block;
81
+ color: initial;
82
+ text-decoration: none;
83
+ outline: none;
84
+ }
85
+
94
86
  &__item {
95
87
  margin: 0 !important;
96
88
  user-select: none !important;
@@ -120,12 +112,12 @@ export default defineComponent({
120
112
  height: 40px;
121
113
  position: absolute;
122
114
  left: 0;
123
- animation: indicator-fade-in .25s;
115
+ animation: indicator-fade-in 0.25s;
124
116
  }
125
117
  }
126
118
  }
127
119
 
128
- &__link {
120
+ &__cell {
129
121
  cursor: pointer !important;
130
122
  font-size: 14px !important;
131
123
  color: var(--site-config-color-text) !important;