File size: 873 Bytes
89ce340 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
import { storeToRefs } from 'pinia'
import { useMainStore } from '@/store'
export default () => {
const mainStore = useMainStore()
const { richTextAttrs, textFormatPainter } = storeToRefs(mainStore)
const toggleTextFormatPainter = (keep = false) => {
if (textFormatPainter.value) mainStore.setTextFormatPainter(null)
else {
mainStore.setTextFormatPainter({
keep,
bold: richTextAttrs.value.bold,
em: richTextAttrs.value.em,
underline: richTextAttrs.value.underline,
strikethrough: richTextAttrs.value.strikethrough,
color: richTextAttrs.value.color,
backcolor: richTextAttrs.value.backcolor,
fontname: richTextAttrs.value.fontname,
fontsize: richTextAttrs.value.fontsize,
align: richTextAttrs.value.align,
})
}
}
return {
toggleTextFormatPainter,
}
}
|