Ember component wrapper for simditor.
- Upgrade Ember to 3.85
- Use native class rewrite addon
- Lock simditor dependence
- Change ci to github action
Different from previous version, you must wrap content in object. See issue 6 for why.
In your ember-cli project, install this addon from npm
ember install ember-cli-simditor
or install the latest version from github
ember install git+https://github.com/wecatch/ember-cli-simditor
<SimditorEditor
@value={{get this.model 'one'}}
@update={{fn (mut this.model.one.content)}}
@editor={{fn (mut this.editor)}}
@toolbar={{this.toolbar}}
@onValuechanged={{this.valuechanged}}
/>
You must wrap content in one object, that means model object must have one property called content
for component to render, visit issue 6 for why.
By default the content property name is content
, you can custome the property name with name
argument
<SimditorEditor
@value={{this.model}}
@update={{fn (mut this.model.html)}}
@editor={{fn (mut this.editor)}}
@toolbar={{this.toolbar}}
@onValuechanged={{this.valuechanged}}
@name='html'/>
English by default
<SimditorEditor />
Chinese
<SimditorEditor @locale='zh-CN'/>
In this addon , on
prefix must be used for all events name. For sample, valuechanged => OnValuechanged.
- valuechanged => onValuechanged
- selectionchanged => onSelectionchanged
- decorate => onDecorate
- undecorate = > onUndecorate
- pasting => onPasting
- blur => onBlur
- destroy => onDestroy
npm test
(Runsember try:testall
to test your addon against multiple Ember versions)ember test
ember test --server