Skip to content

Commit

Permalink
fix: opti readme
Browse files Browse the repository at this point in the history
  • Loading branch information
sanshuiyijing committed Jul 4, 2024
1 parent a564ecf commit 1f9d3ef
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,24 @@ https://github.com/tidbcloud/tisqleditor/assets/1284531/732b600f-5b4e-45d3-a3d2-
See [editor.tsx](./packages/playground/src/components/biz/editor-panel/editor.tsx) or [editor-example.tsx](./packages/playground/src/examples/editor-example.tsx) to get more details.

```shell
pnpm add @tidbcloud/tisqleditor-react @tidbcloud/codemirror-extension-themes @tidbcloud/codemirror-extension-cur-sql-gutter @tidbcloud/codemirror-extension-basic-setup
pnpm add @tidbcloud/tisqleditor-react @tidbcloud/codemirror-extension-themes @tidbcloud/codemirror-extension-cur-sql-gutter
```

```tsx
import { SQLEditor } from '@tidbcloud/tisqleditor-react'
import { oneDark } from '@tidbcloud/codemirror-extension-themes'
import { curSqlGutter } from '@tidbcloud/codemirror-extension-cur-sql-gutter'
import { basicSetup } from '@tidbcloud/codemirror-extension-basic-setup'

export function Editor() {
return (
<SQLEditor
editorId="MySQLEditor"
doc={'sele'}
theme={oneDark}
basicSetupOptions={{
autocompletion: true
}}
extraExts={[
basicSetup(),
curSqlGutter()
// here you can add some other extensions as you need
]}
Expand Down

0 comments on commit 1f9d3ef

Please sign in to comment.