mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2026-02-05 15:45:36 +00:00
优化
This commit is contained in:
parent
f5af99fa61
commit
4d0e62b850
@ -106,20 +106,24 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 创建后
|
||||||
function onCreated(editor: any) {
|
function onCreated(editor: any) {
|
||||||
Editor.value = editor;
|
Editor.value = editor;
|
||||||
onDisabled();
|
onDisabled();
|
||||||
onHeight();
|
onHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 聚焦
|
||||||
function onFocus(editor: any) {
|
function onFocus(editor: any) {
|
||||||
emit("focus", editor);
|
emit("focus", editor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 失焦
|
||||||
function onBlur(editor: any) {
|
function onBlur(editor: any) {
|
||||||
emit("blur", editor);
|
emit("blur", editor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 值改变
|
||||||
function onChange() {
|
function onChange() {
|
||||||
if (value.value == "<p><br></p>") {
|
if (value.value == "<p><br></p>") {
|
||||||
value.value = "";
|
value.value = "";
|
||||||
@ -129,6 +133,7 @@ export default defineComponent({
|
|||||||
emit("change", value.value);
|
emit("change", value.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 文件选择
|
||||||
function onFileConfirm(files: any[]) {
|
function onFileConfirm(files: any[]) {
|
||||||
if (files.length > 0) {
|
if (files.length > 0) {
|
||||||
files.forEach((file) => {
|
files.forEach((file) => {
|
||||||
@ -139,6 +144,13 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 设置高度
|
||||||
|
function onHeight() {
|
||||||
|
const { style } = refs.editor.querySelector(".w-e-text-container");
|
||||||
|
style.maxHeight = parsePx(props.maxHeight || "auto");
|
||||||
|
style.height = parsePx(props.height);
|
||||||
|
}
|
||||||
|
|
||||||
// 禁用
|
// 禁用
|
||||||
function onDisabled() {
|
function onDisabled() {
|
||||||
if (props.disabled) {
|
if (props.disabled) {
|
||||||
@ -150,13 +162,6 @@ export default defineComponent({
|
|||||||
|
|
||||||
watch(() => props.disabled, onDisabled);
|
watch(() => props.disabled, onDisabled);
|
||||||
|
|
||||||
// 设置高度
|
|
||||||
function onHeight() {
|
|
||||||
const scroll = refs.editor.querySelector(".w-e-text-container");
|
|
||||||
scroll.style.maxHeight = parsePx(props.maxHeight || "auto");
|
|
||||||
scroll.style.height = parsePx(props.height);
|
|
||||||
}
|
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => {
|
() => {
|
||||||
return [props.height, props.maxHeight];
|
return [props.height, props.maxHeight];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user