Markup Image with Vue.js
Installation
Usage
import Editor from 'vue-image-markup';Example:
<Editor :canvasWidth="canvasWidth" :canvasHeight="canvasHeight" ref="editor" editorId="canvasId"/>
mounted() {
$this.$refs.editor.set(this.editor.mode,this.editor.options);
}Function set(type,params)
type,params)With the set() function you choose editor's mode,which should get two parameters type and params
type and paramsText Mode
set('text',params) to enable text mode in editor,where params must be object and has it's default value
set('text',params) to enable text mode in editor,where params must be object and has it's default valueCircle Mode
set('circle',params) to enable circle mode in editor,where params must be object and has it's default value
set('circle',params) to enable circle mode in editor,where params must be object and has it's default valueRectangle Mode
set('rect',params) to enable rect mode in editor,where params must be object and has it's default value
set('rect',params) to enable rect mode in editor,where params must be object and has it's default valueSelect Mode
set('selectMode') to enable select mode in editor. This mode disable all other types editing and enable select mode for user can move,resize or rotate selected object.This function hasn't params parameter
set('selectMode') to enable select mode in editor. This mode disable all other types editing and enable select mode for user can move,resize or rotate selected object.This function hasn't params parameterArrow Mode
set('arrow',params) to enable arrow mode in editor,where params must be object and has it's default value
set('arrow',params) to enable arrow mode in editor,where params must be object and has it's default valueFree Drawing Mode
set('freeDrawing',params) to enable free drawing mode in editor,where params must be object and has it's default value
set('freeDrawing',params) to enable free drawing mode in editor,where params must be object and has it's default valueCrop Mode
set('crop') to enable crop mode in editor,where params must be cropper's parameters and has it's default value. After calling the function, the cropper will be shown in editor.
set('crop') to enable crop mode in editor,where params must be cropper's parameters and has it's default value. After calling the function, the cropper will be shown in editor.Eraser Mode
set('eraser') to enable eraser mode in editor, which will remove the object from editor when the object will be clicked.
set('eraser') to enable eraser mode in editor, which will remove the object from editor when the object will be clicked.Function setBackgroundImage(imageUrl)
setBackgroundImage(imageUrl) to set editor background image
setBackgroundImage(imageUrl) to set editor background imageFunction uploadImage(e)
uploadImage(e) to set background of canvas
uploadImage(e) to set background of canvasFunction saveImage()
saveImage() to save your image,which returns image in base64 format.
saveImage() to save your image,which returns image in base64 format.Function clear()
clear() function delete editor's all objects
clear() function delete editor's all objectsFunction undo()
With the help of undo() function you will be able to remove your last object you have added
Function redo()
With the help of redo() method you will be able to restore your last object which have been removed
Function getObjectsById(id)
With the help of getObjectsById(id) method you will be able to get object by id
Credits
Last updated