SMEditor
✎ based on Vue. Js 2.0 + graphite document style rich text editor, lightweight, fast and elegant
The online preview
feedback
contact
About the author
The cause of
The wangEditor we have been using before cannot meet the needs of our editors and PM, and there are many problems in the process of use. The effect of Simditor experience is not good, and the maintenance is not good. At present, the technical selection of our company’s geek Park background management system has shifted to Vue, so we have this wheel.
function
- [x] Light, fast 48 KB
- [x] Automatically add picture description box (similar to simple book)
- [x] Copy upload, multiple batch upload
- [x] Lightweight backup, Restore, preview
- [X] code simplification, suitable for secondary development
- [x] Other editor features
- [] Mobile terminal
use
/ / installation
npm install smeditor
/ / introduction
import SMEditor from 'smeditor'
// Global components
Vue.use(SMEditor)
// Local components
components: {
'smeditor': SMEditor
}
/ / use
<smeditor :config='config'></smeditor>
Copy the code
configuration
const config = {
// Interface address
uploadUrl: ' '.// form filename
uploadName: ' '.// Other parameters
uploadParams: {},
// Upload success callback
uploadCallback: (data) = > {
console.log(data)
return 'blob:https://fiddle.jshell.net/00a0b0b4-d19a-4860-9796-137692aef36f'
},
// Upload failed callback, optional
uploadFailed: (err) = > {
console.log(err)
}
}
Copy the code
shortcuts
Ctrl + S Save Ctrl + P preview (new window)Copy the code
Run locally
npm run dev
npm run build
Copy the code
exceptional
If you find it rewarding, feel free to tip me ———— to encourage me to output more quality open source content