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

有没有相关的调试方法什么的? #39

Closed
JaxsonWang opened this issue Dec 19, 2017 · 6 comments
Closed

有没有相关的调试方法什么的? #39

JaxsonWang opened this issue Dec 19, 2017 · 6 comments

Comments

@JaxsonWang
Copy link

我想把您的项目做成WordPress的插件,过程中发现如下问题:

image

所以想问问有什么办法在控制台查看相关报错信息,谢谢!

@JaxsonWang
Copy link
Author

image

@Houfeng
Copy link
Owner

Houfeng commented Dec 19, 2017

能否提供更多的信息,比如浏览器及版本,并贴更多的代码,让我重现一下这个问题?

@JaxsonWang
Copy link
Author

MacOS 10.13.12
Chrome 63.0.3239.84(正式版本)(64 位)

编辑器配置安装文档默认的配置:

var mditor =  Mditor.fromTextarea(document.getElementById('wp-content-editor-container'));

//获取或设置编辑器的值
mditor.on('ready',function(){
        mditor.value = '** hello **';
        console.log(mditor.value);
});

FireFox Quantum 57.0.1 (64 位):

image

TypeError: this.textarea is undefined

getValue  index.js:178:4
onReady/<  index.js:28:15

Safari 11.0.2 (13604.4.7.1.3)控制台报错如下:

TypeError: undefined is not an object (evaluating 'this.textarea.value')

@Houfeng
Copy link
Owner

Houfeng commented Dec 20, 2017

@JaxsonWang
ID 为 wp-content-editor-containertextarea 确实存在?并在 mditor 的初始化之前?

@JaxsonWang
Copy link
Author

呃,是textarea ?div不行吗?如果是这样的话,那的确麻烦多了

@Houfeng
Copy link
Owner

Houfeng commented Dec 21, 2017

@JaxsonWang

var mditor = new Mditor();
// 挂载到指定的元素
mditor.$mount(document.body); 

这样也能创建 mditor 实例

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