mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-01-18 06:03:22 +08:00
refactoring
This commit is contained in:
parent
3c49928347
commit
2e62e94852
@ -1,5 +1,5 @@
|
||||
import React, { useState } from 'react'
|
||||
import extensions from '@tiptap/starter-kit'
|
||||
import { defaultExtensions } from '@tiptap/starter-kit'
|
||||
import { useEditor, Editor } from './components/Editor'
|
||||
|
||||
// Menu bar example component
|
||||
@ -60,7 +60,7 @@ export default () => {
|
||||
<Editor
|
||||
value={value}
|
||||
onChange={setValue}
|
||||
extensions={extensions()}
|
||||
extensions={defaultExtensions()}
|
||||
>
|
||||
<MenuBar />
|
||||
</Editor>
|
||||
|
@ -10,7 +10,7 @@ See an example with `autoFocus: true` here:
|
||||
|
||||
```js
|
||||
import { Editor } from '@tiptap/core'
|
||||
import defaultExtensions from '@tiptap/starter-kit'
|
||||
import { defaultExtensions } from '@tiptap/starter-kit'
|
||||
|
||||
new Editor({
|
||||
element: document.getElementsByClassName('element'),
|
||||
|
@ -20,7 +20,7 @@ Great, that should be enough to start. Here is the most essential code you need
|
||||
|
||||
```js
|
||||
import { Editor } from '@tiptap/core'
|
||||
import defaultExtensions from '@tiptap/starter-kit'
|
||||
import { defaultExtensions } from '@tiptap/starter-kit'
|
||||
|
||||
new Editor({
|
||||
element: document.getElementsByClassName('element'),
|
||||
|
@ -17,7 +17,7 @@ import BulletList from '@tiptap/extension-bullet-list'
|
||||
import OrderedList from '@tiptap/extension-ordered-list'
|
||||
import ListItem from '@tiptap/extension-list-item'
|
||||
|
||||
export default function defaultExtensions() {
|
||||
export function defaultExtensions() {
|
||||
return [
|
||||
Dropcursor(),
|
||||
Gapcursor(),
|
||||
|
@ -1,7 +1,2 @@
|
||||
import originalDefaultExtensions from '@tiptap/starter-kit'
|
||||
|
||||
export * from '@tiptap/starter-kit'
|
||||
export * from '@tiptap/vue'
|
||||
|
||||
export function defaultExtensions() {
|
||||
return originalDefaultExtensions()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user