@designcrowd/fe-shared-lib 1.0.2-ast-dropdown → 1.0.2
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
|
@@ -15,15 +15,10 @@ export const Sample = () => {
|
|
|
15
15
|
DropdownItem,
|
|
16
16
|
Pill,
|
|
17
17
|
},
|
|
18
|
-
data() {
|
|
19
|
-
return {
|
|
20
|
-
show: true,
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
18
|
template: `
|
|
24
19
|
<div class="tw-font-sans tw-w-1/4">
|
|
25
|
-
<Dropdown menu-align="right"
|
|
26
|
-
<DropdownItem
|
|
20
|
+
<Dropdown menu-align="right">
|
|
21
|
+
<DropdownItem>
|
|
27
22
|
<span class="tw-grow">Menu item 1</span>
|
|
28
23
|
<Pill class="tw-text-white" :style="{ background: 'blue' }">Blue</Pill>
|
|
29
24
|
</DropdownItem>
|
|
@@ -36,7 +36,6 @@
|
|
|
36
36
|
</div>
|
|
37
37
|
</template>
|
|
38
38
|
<script>
|
|
39
|
-
import { watch } from 'vue';
|
|
40
39
|
import Icon from '../Icon/Icon.vue';
|
|
41
40
|
|
|
42
41
|
export default {
|
|
@@ -68,11 +67,6 @@ export default {
|
|
|
68
67
|
required: false,
|
|
69
68
|
default: false,
|
|
70
69
|
},
|
|
71
|
-
show: {
|
|
72
|
-
type: Boolean,
|
|
73
|
-
required: false,
|
|
74
|
-
default: false,
|
|
75
|
-
}
|
|
76
70
|
},
|
|
77
71
|
data: () => ({
|
|
78
72
|
isMenuVisible: false,
|
|
@@ -82,26 +76,15 @@ export default {
|
|
|
82
76
|
return (this.$slots.default || []).filter((s) => s.tag);
|
|
83
77
|
},
|
|
84
78
|
},
|
|
85
|
-
watch: {
|
|
86
|
-
show() {
|
|
87
|
-
this.isMenuVisible = this.show;
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
mounted() {
|
|
91
|
-
this.isMenuVisible = this.show;
|
|
92
|
-
},
|
|
93
79
|
methods: {
|
|
94
80
|
onToggleMenu() {
|
|
95
81
|
this.isMenuVisible = !this.isMenuVisible;
|
|
96
|
-
this.$emit('update:show', this.isMenuVisible);
|
|
97
82
|
},
|
|
98
83
|
hideMenu() {
|
|
99
84
|
this.isMenuVisible = false;
|
|
100
|
-
this.$emit('update:show', false);
|
|
101
85
|
},
|
|
102
86
|
showMenu() {
|
|
103
87
|
this.isMenuVisible = true;
|
|
104
|
-
this.$emit('update:show', true);
|
|
105
88
|
},
|
|
106
89
|
},
|
|
107
90
|
};
|