Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问有什么方式能卸载编辑器吗? #26

Open
zhangjh opened this issue Mar 29, 2017 · 1 comment
Open

请问有什么方式能卸载编辑器吗? #26

zhangjh opened this issue Mar 29, 2017 · 1 comment

Comments

@zhangjh
Copy link

zhangjh commented Mar 29, 2017

比如我需要通过一个选项组来切换是否是普通的富文本编辑器或者是markdown编辑器?
我发现mditor在渲染后就一直存在了,有没有什么方式能在选择普通富文本编辑器的时候让我卸载mditor渲染普通的编辑器?

@Houfeng
Copy link
Owner

Houfeng commented Mar 29, 2017

@zhangjh

第一种方式:

单独放一个 textarea ,自行控制谁可见,并在切换时同步 value

第二种方式:

更新到 1.1.12,新增了一个 switchTextarea 方法,可在 mditor 和 textarea 之间切换,如下

//仅通过 fromTextarea 创建的实例才能使用  switchTextarea 方法
let mditor = Mditor.fromTextarea(textarea);
mditor.switchTextarea();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants