docs: explain navigation, search and content components
This commit is contained in:
1 parent
2ff311005e
commit
179c6febf0
10 files changed
+34
No files matched your search
@@ -1,4 +1,5 @@
|
||||
<script>
|
||||
// 轻量富文本输入:用浏览器编辑命令维护选区,并在模型输入/输出边界清洗 HTML。
|
||||
import "~/assets/styles/RichTextEditor.NkmgPT5m.css";
|
||||
import { renderList } from "vue";
|
||||
import { onMounted } from "vue";
|
||||
@@ -100,12 +101,14 @@ var g = [`aria-label`],
|
||||
icon: `pi pi-align-right`,
|
||||
},
|
||||
];
|
||||
// 仅保存编辑区域内的选区,点击工具栏后可恢复到用户原来的光标位置。
|
||||
function S() {
|
||||
let e = window.getSelection();
|
||||
e?.rangeCount &&
|
||||
y.value?.contains(e.anchorNode) &&
|
||||
(b = e.getRangeAt(0).cloneRange());
|
||||
}
|
||||
// 空白正文输出空串,其余内容先清洗再同步 v-model,并更新当前选区。
|
||||
function C() {
|
||||
y.value &&
|
||||
((m.value = y.value.innerText.trim()
|
||||
@@ -125,6 +128,7 @@ var g = [`aria-label`],
|
||||
(document.execCommand(e, !1), C());
|
||||
}
|
||||
}
|
||||
// 粘贴只接收纯文本,阻止剪贴板 HTML 直接带入额外标签和属性。
|
||||
function T(e) {
|
||||
(e.preventDefault(),
|
||||
!u.disabled &&
|
||||
|
||||
Reference in new issue
Block a user