工具栏补表格插入:插入组新增表格按钮,光标处铺 2×2 模板(表头/分隔/两行内容)
This commit is contained in:
@@ -611,6 +611,15 @@ function tbTask() {
|
|||||||
function tbHr() {
|
function tbHr() {
|
||||||
withSelection((s, e) => insertAtCursor('\n---\n', s, e))
|
withSelection((s, e) => insertAtCursor('\n---\n', s, e))
|
||||||
}
|
}
|
||||||
|
function tbTable() {
|
||||||
|
withSelection((s, e) =>
|
||||||
|
insertAtCursor(
|
||||||
|
'\n| 列 A | 列 B |\n| --- | --- |\n| 内容 | 内容 |\n| 内容 | 内容 |\n',
|
||||||
|
s,
|
||||||
|
e
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
function openLink() {
|
function openLink() {
|
||||||
showLinkInput.value = true
|
showLinkInput.value = true
|
||||||
@@ -858,6 +867,8 @@ const tbGroups = computed(() => [
|
|||||||
icon: 'M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71' },
|
icon: 'M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71' },
|
||||||
{ key: 'img', title: '图片', run: openImage, show: mode.value === 'md',
|
{ key: 'img', title: '图片', run: openImage, show: mode.value === 'md',
|
||||||
icon: 'M21 15l-5-5L5 21M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2zM8.5 8.5h.01' },
|
icon: 'M21 15l-5-5L5 21M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2zM8.5 8.5h.01' },
|
||||||
|
{ key: 'table', title: '表格', run: tbTable, show: mode.value === 'md',
|
||||||
|
icon: 'M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2zM3 10h18M10 21V10' },
|
||||||
{ key: 'date', title: '插入今天日期', run: insertDate, show: mode.value === 'md',
|
{ key: 'date', title: '插入今天日期', run: insertDate, show: mode.value === 'md',
|
||||||
icon: 'M16 2v4M8 2v4M3 10h18M5 4h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z' }
|
icon: 'M16 2v4M8 2v4M3 10h18M5 4h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z' }
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user