mirror of https://github.com/fantasticit/think.git
tiptap: fix type
parent
a589db9978
commit
7e46e7ba65
|
@ -7,7 +7,7 @@ const resolveImageEl = (element) => (element.nodeName === 'IMG' ? element : elem
|
|||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
iamge: {
|
||||
setEmptyImage: () => ReturnType;
|
||||
setEmptyImage: (arg: { width?: number | string }) => ReturnType;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ const DEFAULT_MIND_DATA = {
|
|||
};
|
||||
|
||||
export interface IMindAttrs {
|
||||
width?: number;
|
||||
width?: number | string;
|
||||
height?: number;
|
||||
data?: Record<string, unknown>;
|
||||
template?: string;
|
||||
|
|
|
@ -91,7 +91,6 @@ export const COMMANDS: ICommand[] = [
|
|||
{
|
||||
icon: <IconImage />,
|
||||
label: '图片',
|
||||
// @ts-ignore
|
||||
action: (editor) => editor.chain().focus().setEmptyImage({ width: '100%' }).run(),
|
||||
},
|
||||
{
|
||||
|
@ -123,7 +122,6 @@ export const COMMANDS: ICommand[] = [
|
|||
icon: <IconMind />,
|
||||
label: '思维导图',
|
||||
action: (editor) => {
|
||||
// @ts-ignore
|
||||
editor.chain().focus().setMind({ width: '100%' }).run();
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue