Browse Source

add dot-only prop to DotButton

axolotle 3 năm trước cách đây
mục cha
commit
413673c2d5

+ 5 - 3
src/components/globals/DotButton.vue

@@ -1,7 +1,7 @@
 <template>
   <b-button
     class="dot-btn"
-    :class="['dot-btn-' + variant, { 'active': active, 'show': show }]"
+    :class="['dot-btn-' + variant, { 'active': active, 'show': show, 'hide': dotOnly }]"
     v-bind="$attrs" v-on="$listeners"
     :active="active"
     :variant="variant"
@@ -24,7 +24,8 @@ export default {
   props: {
     variant: { type: String, required: true },
     active: { type: Boolean, default: false },
-    hovered: { type: Boolean, default: false }
+    hovered: { type: Boolean, default: false },
+    dotOnly: { type: Boolean, default: false }
   },
 
   data () {
@@ -52,7 +53,8 @@ export default {
   word-break: keep-all;
   white-space: pre;
 
-  &:not(.show) {
+  &:not(.show),
+  &.hide {
     min-height: 1.1875rem;
     min-width: 1.1875rem;
     padding: 0;

+ 1 - 0
src/components/nodes/NodeViewChildList.vue

@@ -9,6 +9,7 @@
           @click="onOpen(child.id)"
           :variant="child.variant"
           :active="activeNodes.includes(child.id)"
+          dot-only
         >
           {{ $t('variants.' + child.variant) }}
         </dot-button>