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' {
|
declare module '@tiptap/core' {
|
||||||
interface Commands<ReturnType> {
|
interface Commands<ReturnType> {
|
||||||
iamge: {
|
iamge: {
|
||||||
setEmptyImage: () => ReturnType;
|
setEmptyImage: (arg: { width?: number | string }) => ReturnType;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ const DEFAULT_MIND_DATA = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface IMindAttrs {
|
export interface IMindAttrs {
|
||||||
width?: number;
|
width?: number | string;
|
||||||
height?: number;
|
height?: number;
|
||||||
data?: Record<string, unknown>;
|
data?: Record<string, unknown>;
|
||||||
template?: string;
|
template?: string;
|
||||||
|
|
|
@ -91,7 +91,6 @@ export const COMMANDS: ICommand[] = [
|
||||||
{
|
{
|
||||||
icon: <IconImage />,
|
icon: <IconImage />,
|
||||||
label: '图片',
|
label: '图片',
|
||||||
// @ts-ignore
|
|
||||||
action: (editor) => editor.chain().focus().setEmptyImage({ width: '100%' }).run(),
|
action: (editor) => editor.chain().focus().setEmptyImage({ width: '100%' }).run(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -123,7 +122,6 @@ export const COMMANDS: ICommand[] = [
|
||||||
icon: <IconMind />,
|
icon: <IconMind />,
|
||||||
label: '思维导图',
|
label: '思维导图',
|
||||||
action: (editor) => {
|
action: (editor) => {
|
||||||
// @ts-ignore
|
|
||||||
editor.chain().focus().setMind({ width: '100%' }).run();
|
editor.chain().focus().setMind({ width: '100%' }).run();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue