@ewizardjs/vue-editor
v4.4.1
Published
const edit = require('vue-editor');
Downloads
20
Keywords
Readme
Usage
const edit = require('vue-editor');
edit('path/to/slide/index.vue')
.setTemplate(template)
.setStyle(style)
.save();
Arguments template
and style
should be taken from cobat API .getSlide()
method on front end:
co.getSlide(slideId)
.then({ template, style } => {...}
Example of .setTemplate
's template argument:
<div class="slide">
<h1>Slide 1</h1>
<div class="slide">
Example of .setStyle
's style argument
{
'#v-header-9dfe': {
background: 'green',
color: 'black'
},
'#v-button-1111': {
background: 'white',
'line-height': '1em'
}
};
validateContentType(contentPath, contentType)
Arguments:
{String} contentPath
{String} contentType
Returns:
{Promise}
Usage: Take content path and content type and validate it.
Success Response: Fulfills if content type corresponding to requested.
Error Response:
ContentTypeValidationError
- type not corresponding to requested.EwizardContentValidationError
- package is not an eWizard content.