https://github.com/lkiarest/vue-ueditor
ueditor component for vue1.x
https://github.com/lkiarest/vue-ueditor
Last synced: 11 months ago
JSON representation
ueditor component for vue1.x
- Host: GitHub
- URL: https://github.com/lkiarest/vue-ueditor
- Owner: lkiarest
- License: mit
- Created: 2017-07-03T06:56:13.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-04T05:41:23.000Z (almost 9 years ago)
- Last Synced: 2025-05-26T17:25:27.731Z (about 1 year ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
UEditor based Rich Text Editor component for vue 1.x
### install
`` shell
npm i vueueditor -S
``
### use
```html
import Ueditor from 'vueueditor'
export default {
data: () => ({
content: 'Hello World',
editorOpts: { // refer to 'http://fex.baidu.com/ueditor/#start-config'
maximumWords: 500
},
enabled: true
}),
components: {Ueditor}
}
```
### options
Refer to [UEditor Start Config](http://fex.baidu.com/ueditor/#start-config)
### methods
#### editor()
Get original UE instance, then you can do more things with the [UEditor Document](http://fex.baidu.com/ueditor/)
```javascript
var editor = this.$refs.ue.editor()
```
#### getContent()
Get html content from editor
```javascript
var content = this.$refs.ue.getContent()
```
#### setContent(val)
Set html content to editor
```javascript
var content = this.$refs.ue.setContent('Hello World')
// or change the bound data model
this.content = 'Hello World'
```
#### enable()
Enable to edit
```
this.$refs.ue.enable()
// or change the bound data model
this.enabled = true
```
#### disable()
Disable to edit
```
this.$refs.ue.disable()
// or change the bound data model
this.enabled = false
```
#### clear()
Clear all contents
```
this.$refs.ue.clear()
```
#### getContentLength(ignoreHtml)
Get length of content
**ignoreHtml** will ignore all html tags if set to true
```
this.$refs.ue.getContentLength()
```