This repository was archived by the owner on Mar 27, 2025. It is now read-only.
File tree 4 files changed +53
-4
lines changed
packages/bootstrap-vue-next/src/directives
4 files changed +53
-4
lines changed Original file line number Diff line number Diff line change @@ -15,4 +15,4 @@ export default {
15
15
opencollectiveUrl : 'https://opencollective.com/bootstrap-vue-next' ,
16
16
} )
17
17
} ,
18
- } as Theme
18
+ } satisfies Theme
Original file line number Diff line number Diff line change 16
16
17
17
## Demo
18
18
19
- Docs to be made
19
+ <HighlightCard >
20
+ <BCard v-b-color-mode =" currentColor " >
21
+ <BButton @click="changeColor">
22
+ Current color: {{ currentColor }}
23
+ </BButton>
24
+ </BCard >
25
+ <template #html>
26
+
27
+ ``` vue
28
+ <template>
29
+ <BCard v-b-color-mode="currentColor">
30
+ <BButton @click="changeColor"> Current color: {{ currentColor }} </BButton>
31
+ </BCard>
32
+ </template>
33
+
34
+ <script setup lang="ts">
35
+ import {vBColorMode} from 'bootstrap-vue-next'
36
+
37
+ const currentColor = ref<'light' | 'dark'>('dark')
38
+
39
+ const changeColor = () => {
40
+ currentColor.value = currentColor.value === 'dark' ? 'light' : 'dark'
41
+ }
42
+ </script>
43
+ ```
44
+
45
+ </template >
46
+
47
+ </HighlightCard >
48
+
49
+ <script setup lang =" ts " >
50
+ import {ref } from ' vue'
51
+ import {vBColorMode , BButton , BCard } from ' bootstrap-vue-next'
52
+ import HighlightCard from ' ../../components/HighlightCard.vue'
53
+
54
+ const currentColor = ref< ' light' | ' dark' > (' dark' )
55
+
56
+ const changeColor = () => {
57
+ currentColor .value = currentColor .value === ' dark' ? ' light' : ' dark'
58
+ }
59
+ </script >
Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ export default {
15
15
16
16
const text = resolveContent ( binding . value , el )
17
17
18
+ if ( ! text . content && ! text . title ) return
19
+
18
20
el . $__state = ref ( {
19
21
...resolveDirectiveProps ( binding , el ) ,
20
22
...text ,
@@ -27,6 +29,8 @@ export default {
27
29
28
30
const text = resolveContent ( binding . value , el )
29
31
32
+ if ( ! text . content && ! text . title ) return
33
+
30
34
if ( ! el . $__state ) return
31
35
el . $__state . value = {
32
36
...resolveDirectiveProps ( binding , el ) ,
@@ -36,4 +40,4 @@ export default {
36
40
beforeUnmount ( el ) {
37
41
unbind ( el )
38
42
} ,
39
- } as Directive < ElementWithPopper >
43
+ } satisfies Directive < ElementWithPopper >
Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ export default {
15
15
16
16
const text = resolveContent ( binding . value , el )
17
17
18
+ if ( ! text . content && ! text . title ) return
19
+
18
20
el . $__state = ref ( {
19
21
...resolveDirectiveProps ( binding , el ) ,
20
22
title : text . title ?? text . content ?? '' ,
@@ -27,6 +29,9 @@ export default {
27
29
if ( ! isActive ) return
28
30
29
31
const text = resolveContent ( binding . value , el )
32
+
33
+ if ( ! text . content && ! text . title ) return
34
+
30
35
if ( ! el . $__state ) return
31
36
el . $__state . value = {
32
37
...resolveDirectiveProps ( binding , el ) ,
@@ -37,4 +42,4 @@ export default {
37
42
beforeUnmount ( el ) {
38
43
unbind ( el )
39
44
} ,
40
- } as Directive < ElementWithPopper >
45
+ } satisfies Directive < ElementWithPopper >
You can’t perform that action at this time.
0 commit comments