@varlet/cli 1.25.0-alpha.1642520000820 → 1.25.0-alpha.1642582155449

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": "1.25.0-alpha.1642520000820",
3
+ "version": "1.25.0-alpha.1642582155449",
4
4
  "description": "cli of varlet",
5
5
  "bin": {
6
6
  "varlet-cli": "./lib/index.js"
@@ -33,9 +33,9 @@
33
33
  "@babel/helper-plugin-utils": "^7.14.5",
34
34
  "@babel/preset-env": "^7.14.8",
35
35
  "@babel/preset-typescript": "^7.14.5",
36
- "@varlet/icons": "1.25.0-alpha.1642520000820",
37
- "@varlet/markdown-vite-plugin": "1.25.0-alpha.1642520000820",
38
- "@varlet/touch-emulator": "1.25.0-alpha.1642520000820",
36
+ "@varlet/icons": "1.25.0-alpha.1642582155449",
37
+ "@varlet/markdown-vite-plugin": "1.25.0-alpha.1642582155449",
38
+ "@varlet/touch-emulator": "1.25.0-alpha.1642582155449",
39
39
  "@vitejs/plugin-vue": "1.9.2",
40
40
  "@vitejs/plugin-vue-jsx": "1.1.8",
41
41
  "@vue/babel-plugin-jsx": "1.0.7",
@@ -74,7 +74,7 @@
74
74
  "@types/semver": "^7.3.9"
75
75
  },
76
76
  "peerDependencies": {
77
- "@varlet/touch-emulator": "1.25.0-alpha.1642520000820",
77
+ "@varlet/touch-emulator": "1.25.0-alpha.1642582155449",
78
78
  "@vue/test-utils": "^2.0.0-rc.6",
79
79
  "clipboard": "^2.0.6",
80
80
  "live-server": "^1.2.1",
@@ -11,7 +11,7 @@
11
11
  <slot name="left" />
12
12
  <div
13
13
  class="var-site-app-bar__title"
14
- :style="{ paddingLeft: $slots.left ? 0 : undefined }"
14
+ :style="{ paddingLeft }"
15
15
  v-if="titlePosition === 'left'"
16
16
  >
17
17
  <slot>{{ title }}</slot>
@@ -25,7 +25,7 @@
25
25
  <div class="var-site-app-bar__right">
26
26
  <div
27
27
  class="var-site-app-bar__title"
28
- :style="{ paddingRight: $slots.right ? 0 : undefined }"
28
+ :style="{ paddingRight }"
29
29
  v-if="titlePosition === 'right'"
30
30
  >
31
31
  <slot>{{ title }}</slot>
@@ -36,12 +36,29 @@
36
36
  </template>
37
37
 
38
38
  <script lang="ts">
39
- import { defineComponent } from 'vue'
39
+ import {defineComponent, onMounted, onUpdated, ref, Ref} from 'vue'
40
40
  import { props } from './props'
41
41
 
42
42
  export default defineComponent({
43
43
  name: 'VarSiteAppBar',
44
44
  props,
45
+ setup(props, { slots }) {
46
+ const paddingLeft: Ref<number | undefined> = ref()
47
+ const paddingRight: Ref<number | undefined> = ref()
48
+
49
+ const computePadding = () => {
50
+ paddingLeft.value = slots.left ? 0 : undefined
51
+ paddingRight.value = slots.right ? 0 : undefined
52
+ }
53
+
54
+ onMounted(computePadding)
55
+ onUpdated(computePadding)
56
+
57
+ return {
58
+ paddingLeft,
59
+ paddingRight
60
+ }
61
+ }
45
62
  })
46
63
  </script>
47
64