Open ghost opened 4 years ago
如题,我有了一个图片管理的组件,负责上传,删除等图片管理,我可以获取到服务器返回的名称和url,所以我需要一个能直接调用的方法用来将服务器返回的图片url和名称插入到编辑器中,为此我试了很多方法都不能奏效。通过查看您的源码,我发现了可以直接调用的方法:insertText,但是好像这个方法不是您要公开的方法,我想确认我这样使用是否合理,或者有更好的办法?谢谢。 这是我的代码:
this.$refs.md.insertText(this.$refs.md.getTextareaDom(),{ prefix: '![' +resp.name+ '](' +resp.url+ ')', subfix: '', str: '' });
同问,请问解决了吗?
如题,我有了一个图片管理的组件,负责上传,删除等图片管理,我可以获取到服务器返回的名称和url,所以我需要一个能直接调用的方法用来将服务器返回的图片url和名称插入到编辑器中,为此我试了很多方法都不能奏效。通过查看您的源码,我发现了可以直接调用的方法:insertText,但是好像这个方法不是您要公开的方法,我想确认我这样使用是否合理,或者有更好的办法?谢谢。 这是我的代码:
this.$refs.md.insertText(this.$refs.md.getTextareaDom(),{ prefix: '![' +resp.name+ '](' +resp.url+ ')', subfix: '', str: '' });