0.8.3 • Published 20 days ago

lexical-vue v0.8.3

Weekly downloads
-
License
MIT
Repository
github
Last release
20 days ago

Lexical Vue

An extensible Vue 3 web text-editor based on Lexical.

For documentation and more information about Lexical, be sure to visit the Lexical website.

Here are some examples of what you can do with Lexical:

Getting started with Vue

Requires Vue >= 3.2.0.

Install lexical and lexical-vue:

npm install lexical lexical-vue # or pnpm or yarn

Below is an example of a basic plain text editor using lexical and lexical-vue.

<script setup lang="ts">
import { $getRoot, $getSelection } from 'lexical'

import {
  LexicalAutoFocusPlugin,
  LexicalComposer,
  LexicalContentEditable,
  LexicalHistoryPlugin,
  LexicalOnChangePlugin,
  LexicalPlainTextPlugin,
} from 'lexical-vue'

const config = {
  editable: true,
  theme: {
    // Theme styling goes here
  },
}

function onError(error) {
  throw error
}

// When the editor changes, you can get notified via the
// LexicalOnChangePlugin!
function onChange(editorState) {
  editorState.read(() => {
    // Read the contents of the EditorState here.
    const root = $getRoot()
    const selection = $getSelection()

    console.log(root, selection)
  })
}
</script>

<template>
  <LexicalComposer :initial-config="config" @error="onError">
    <LexicalPlainTextPlugin>
      <template #contentEditable>
        <LexicalContentEditable />
      </template>
      <template #placeholder>
        <div>
          Enter some text...
        </div>
      </template>
    </LexicalPlainTextPlugin>
    <LexicalOnChangePlugin @change="onChange" />
    <LexicalHistoryPlugin />
    <LexicalAutoFocusPlugin />
  </LexicalComposer>
</template>

For a more complex example, check the rich text editor playground.

Creating custom Lexical nodes with Vue

Contributing

  1. Create a new branch
    • git checkout -b my-new-branch
  2. Commit your changes
    • git commit -a -m 'Description of the changes'
      • There are many ways of doing this and this is just a suggestion
  3. Push your branch to GitHub
    • git push origin my-new-branch
  4. Go to the repository page in GitHub and click on "Compare & pull request"
    • The GitHub CLI allows you to skip the web interface for this step (and much more)

Documentation

https://lexical-vue.vercel.app

Credits

License

MIT

0.8.3

20 days ago

0.8.1

3 months ago

0.8.0

3 months ago

0.8.2

3 months ago

0.7.2

5 months ago

0.7.1

5 months ago

0.5.0

12 months ago

0.7.0

9 months ago

0.5.1

12 months ago

0.6.3

9 months ago

0.6.2

10 months ago

0.6.1

11 months ago

0.6.0

11 months ago

0.3.19

1 year ago

0.3.9

1 year ago

0.3.17

1 year ago

0.3.16

1 year ago

0.3.15

1 year ago

0.3.14

1 year ago

0.3.13

1 year ago

0.3.12

1 year ago

0.3.11

1 year ago

0.3.10

1 year ago

0.4.0

1 year ago

0.3.0

1 year ago

0.3.6

1 year ago

0.3.5

1 year ago

0.3.8

1 year ago

0.3.7

1 year ago

0.3.2

1 year ago

0.3.1

1 year ago

0.3.4

1 year ago

0.3.3

1 year ago

0.2.1

2 years ago

0.2.0

2 years ago

0.2.3

1 year ago

0.2.2

1 year ago

0.2.5

1 year ago

0.2.4

1 year ago

0.1.0

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.7

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.0-beta.5

2 years ago

0.1.0-beta.4

2 years ago

0.1.0-beta.1

2 years ago

0.1.0-beta.7

2 years ago

0.1.0-beta.6

2 years ago

0.1.0-beta.9

2 years ago

0.1.0-beta.8

2 years ago

0.0.9-beta.6

2 years ago

0.0.9-beta.1

2 years ago

0.0.9-beta.5

2 years ago

0.0.9-beta.4

2 years ago

0.0.9-beta.2

2 years ago

0.0.8-beta.7

2 years ago

0.0.8-beta.6

2 years ago

0.0.8-beta.5

2 years ago

0.0.8-beta.4

2 years ago

0.0.8-beta.3

2 years ago

0.0.8-beta.2

2 years ago

0.0.8-beta.1

2 years ago

0.0.7-beta.4

2 years ago

0.0.7-beta.3

2 years ago

0.0.7-beta.2

2 years ago

0.0.7-beta.1

2 years ago

0.0.6-beta.5

2 years ago

0.0.6-beta.3

2 years ago

0.0.6-beta.2

2 years ago

0.0.6-beta.1

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago