清除Ember MobileDoc-kit编辑器数据

时间:2017-11-02 09:50:48

标签: ember.js mobiledoc-kit

我在使用ember-mobile-doc编辑器进行基本任务时遇到了一些麻烦:我希望能够通过操作清除编辑器的内容。

with:

{{#mobiledoc-editor mobiledoc=document}}...{{#/mobiledoc-editor}

我尝试将document设置为falsenull,但没有任何运气。我已经查看了github上的代码,但似乎无法找到前进的道路。

1 个答案:

答案 0 :(得分:1)

由于我现在两次提出这个问题,我需要回答这个问题以免自己麻烦。

jQuery版本:

import {run} from '@ember/runloop'
//inside component
   run(() => {
    $('.mobiledoc-editor__editor').empty();
   });