Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
data-table
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
hookehuyr
2024-08-19 17:10:33 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2ec8a9b2362fef2c642f9dbc5ccbf7604dda49ce
2ec8a9b2
1 parent
bbb41476
表格组件使用命令直接新增一行和文字居中测试
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
src/components/TEditor/index.vue
src/components/TEditor/index.vue
View file @
2ec8a9b
<!--
* @Date: 2024-07-12 13:28:27
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-08-
07 13:19:06
* @LastEditTime: 2024-08-
19 17:09:50
* @FilePath: /data-table/src/components/TEditor/index.vue
* @Description: 文件描述
-->
<template>
<div style="height: 100%; overflow: hidden;">
<!-- <div @click="addRow">新增一行</div>
<div @click="textCenter">文字居中</div> -->
<editor
api-key="no-api-key"
v-model="myValue"
...
...
@@ -212,7 +214,8 @@ const tinymceOptions = {
// toolbar: 'table', // 工具栏显示
toolbar: '', // 工具栏显示
table_toolbar: 'tableinsertrowafter', // table_toolbar 配置
contextmenu: 'tableinsertrowafter', // 右键菜单
// table_toolbar: '', // table_toolbar 配置
contextmenu: 'tableinsertrowafter aligncenter', // 右键菜单
width: $('.table-field-page').width() + 'px',
paste_data_images: false, //允许粘贴图像
// min_height: 300,
...
...
@@ -328,6 +331,13 @@ const onBlur = (e) => {
emits("blur", handleGetContent());
}
const addRow = () => {
tinymce.activeEditor.execCommand('mceTableInsertRowAfter')
}
const textCenter = () => {
tinymce.activeEditor.execCommand('JustifyCenter')
}
defineExpose({
handleSetContent,
handleGetContent,
...
...
Please
register
or
login
to post a comment