From c45940ca8ec8bed49c9a735fc23f8a453eae304a Mon Sep 17 00:00:00 2001 From: qiang Date: Mon, 26 Apr 2021 21:03:42 +0800 Subject: [PATCH] fix: editor emit --- .../src/components/editor/index.tsx | 32 ++++++------------- packages/uni-h5/dist/uni-h5.esm.js | 25 ++------------- 2 files changed, 12 insertions(+), 45 deletions(-) diff --git a/packages/uni-components/src/components/editor/index.tsx b/packages/uni-components/src/components/editor/index.tsx index 3c40e1f43..5067f31e6 100644 --- a/packages/uni-components/src/components/editor/index.tsx +++ b/packages/uni-components/src/components/editor/index.tsx @@ -8,7 +8,11 @@ import QuillClass, { import { useSubscribe } from '@dcloudio/uni-components' import { getRealPath } from '@dcloudio/uni-platform' import { CustomEventTrigger, useCustomEvent } from '../../helpers/useEvent' -import { useKeyboard } from '../../helpers/useKeyboard' +import { + props as keyboardProps, + emit as keyboardEmit, + useKeyboard, +} from '../../helpers/useKeyboard' import HTMLParser from '../../helpers/html-parser' import * as formats from './formats' import loadScript from './load-script' @@ -410,7 +414,7 @@ function useQuill( }) } -const props = { +const props = Object.assign({}, keyboardProps, { id: { type: String, default: '', @@ -435,30 +439,12 @@ const props = { type: [Boolean, String], default: false, }, - disabled: { - type: [Boolean, String], - default: false, - }, - cursorSpacing: { - type: [Number, String], - default: 0, - }, - showConfirmBar: { - type: [Boolean, String], - default: 'auto', - }, - adjustPosition: { - type: [Boolean, String], - default: true, - }, - autoBlur: { - type: [Boolean, String], - default: false, - }, -} +}) + export default /*#__PURE__*/ defineComponent({ name: 'Editor', props, + emit: ['ready', 'focus', 'blur', 'input', 'statuschange', ...keyboardEmit], setup(props, { emit }) { const rootRef: Ref = ref(null) const trigger = useCustomEvent(rootRef, emit) diff --git a/packages/uni-h5/dist/uni-h5.esm.js b/packages/uni-h5/dist/uni-h5.esm.js index f0a1c2c62..06b8c4a26 100644 --- a/packages/uni-h5/dist/uni-h5.esm.js +++ b/packages/uni-h5/dist/uni-h5.esm.js @@ -6060,7 +6060,7 @@ function useQuill(props2, rootRef, trigger) { } }); } -const props$9 = { +const props$9 = Object.assign({}, props$a, { id: { type: String, default: "" @@ -6084,31 +6084,12 @@ const props$9 = { showImgResize: { type: [Boolean, String], default: false - }, - disabled: { - type: [Boolean, String], - default: false - }, - cursorSpacing: { - type: [Number, String], - default: 0 - }, - showConfirmBar: { - type: [Boolean, String], - default: "auto" - }, - adjustPosition: { - type: [Boolean, String], - default: true - }, - autoBlur: { - type: [Boolean, String], - default: false } -}; +}); var index$9 = /* @__PURE__ */ defineComponent({ name: "Editor", props: props$9, + emit: ["ready", "focus", "blur", "input", "statuschange", ...emit$1], setup(props2, { emit: emit2 }) { -- GitLab