hookehuyr

新增左右对齐的文字操作

1 <!-- 1 <!--
2 * @Date: 2024-07-12 13:28:27 2 * @Date: 2024-07-12 13:28:27
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-08-20 11:29:58 4 + * @LastEditTime: 2024-08-21 10:40:56
5 * @FilePath: /data-table/src/components/TEditor/index.vue 5 * @FilePath: /data-table/src/components/TEditor/index.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -9,10 +9,10 @@ ...@@ -9,10 +9,10 @@
9 <div style="height: 100%; overflow: hidden;"> 9 <div style="height: 100%; overflow: hidden;">
10 <div v-if="isCursorInTable" style="padding: 0.5rem 1.25rem;"> 10 <div v-if="isCursorInTable" style="padding: 0.5rem 1.25rem;">
11 <van-icon @click="addRow" name="https://cdn.ipadbiz.cn/custom_form/icon/add-line.png" /> 11 <van-icon @click="addRow" name="https://cdn.ipadbiz.cn/custom_form/icon/add-line.png" />
12 + <van-icon @click="textLeft" name="https://cdn.ipadbiz.cn/custom_form/icon/text-left.png" style="margin-left: 1rem;" />
12 <van-icon @click="textCenter" name="https://cdn.ipadbiz.cn/custom_form/icon/text-align.png" style="margin-left: 1rem;" /> 13 <van-icon @click="textCenter" name="https://cdn.ipadbiz.cn/custom_form/icon/text-align.png" style="margin-left: 1rem;" />
14 + <van-icon @click="textRight" name="https://cdn.ipadbiz.cn/custom_form/icon/text-right.png" style="margin-left: 1rem;" />
13 </div> 15 </div>
14 - <!-- <div @click="addRow">新增一行</div>
15 - <div @click="textCenter">文字居中</div> -->
16 <editor 16 <editor
17 api-key="no-api-key" 17 api-key="no-api-key"
18 v-model="myValue" 18 v-model="myValue"
...@@ -367,6 +367,14 @@ const textCenter = () => { ...@@ -367,6 +367,14 @@ const textCenter = () => {
367 tinymce.activeEditor.execCommand('JustifyCenter') 367 tinymce.activeEditor.execCommand('JustifyCenter')
368 } 368 }
369 369
370 +const textLeft = () => {
371 + tinymce.activeEditor.execCommand('JustifyLeft')
372 +}
373 +
374 +const textRight = () => {
375 + tinymce.activeEditor.execCommand('JustifyRight')
376 +}
377 +
370 defineExpose({ 378 defineExpose({
371 handleSetContent, 379 handleSetContent,
372 handleGetContent, 380 handleGetContent,
......