File tree Expand file tree Collapse file tree
packages/super-editor/src/components/toolbar Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<script setup>
2- import { getCurrentInstance , ref } from ' vue' ;
2+ import { getCurrentInstance , ref , computed } from ' vue' ;
33import ToolbarButton from ' ./ToolbarButton.vue' ;
44import ButtonGroup from ' ./ButtonGroup.vue' ;
55
@@ -18,6 +18,11 @@ const props = defineProps({
1818
1919const isDropdownOpened = ref (false );
2020
21+ const overflowToolbarItem = computed (() => ({
22+ ... props .toolbarItem ,
23+ active: isDropdownOpened,
24+ }));
25+
2126const toggleOverflowMenu = () => {
2227 isDropdownOpened .value = ! isDropdownOpened .value ;
2328};
@@ -30,7 +35,10 @@ const handleCommand = ({ item, argument }) => {
3035<template >
3136 <div class =" overflow-menu" >
3237 <div class =" overflow-menu-trigger" >
33- <ToolbarButton :toolbar-item =" toolbarItem" @buttonClick =" toggleOverflowMenu" />
38+ <ToolbarButton
39+ :toolbar-item =" overflowToolbarItem"
40+ @buttonClick =" toggleOverflowMenu"
41+ />
3442 </div >
3543 <div v-if =" isDropdownOpened" class =" overflow-menu_items" >
3644 <ButtonGroup :toolbar-items =" overflowItems" @command =" handleCommand" class =" superdoc-toolbar-overflow" />
You can’t perform that action at this time.
0 commit comments