https://github.com/zazuko/vue2-prosemirror-markdown
Prosemirror WYSIWYG Markdown Editor Component for Vue2
https://github.com/zazuko/vue2-prosemirror-markdown
Last synced: about 1 year ago
JSON representation
Prosemirror WYSIWYG Markdown Editor Component for Vue2
- Host: GitHub
- URL: https://github.com/zazuko/vue2-prosemirror-markdown
- Owner: zazuko
- License: mit
- Created: 2018-05-14T12:55:00.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-07-25T13:19:53.000Z (almost 8 years ago)
- Last Synced: 2025-04-15T02:09:26.949Z (about 1 year ago)
- Language: JavaScript
- Homepage: https://zazuko.github.io/vue2-prosemirror-markdown/
- Size: 450 KB
- Stars: 8
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vue2-prosemirror-markdown
Plugin to integrate prosemirror with Vue 2
[](https://travis-ci.org/zazuko/vue2-prosemirror-markdown)
## Usage
```js
import Vue from 'vue'
import ProseMirror from 'vue2-prosemirror-markdown'
import App from './App.vue'
Vue.use(ProseMirror)
new Vue({ // eslint-disable-line no-new
el: '#app',
render: (h) => h(App)
})
```
This installs the component, which can be used as...
```html
```
| parameter | values |
|-------------------|---------------------------------------------------------------------------------|
| `textareaConfig` | `{name: 'a-string'}` (required) |
| `mode` | `all`, `editor` (default), `markdown` |
| `initialMarkdown` | binding `:initialMarkdown="someVar"`, as string: `initialMarkdown="**text**"` |
| `customClass` | `'vue-prosemirror'` (default) |
### Events
| event name | called with these arguments |
|--------------------------|------------------------------|
| `contentChange` | `(val, oldVal)`, both are Objects: `{editor: Node, markdown: String}` |
| `contentChangeMarkdown` | `(markdown: String)` |
| `modeChange` | `(val: String, oldVal: String)` |
## Build Setup
``` bash
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
# lint all *.js and *.vue files
npm run lint
# run unit tests
npm test
```
For more information see the [docs for vueify](https://github.com/vuejs/vueify).