毫米或厘米单位转换为px。
问题
我意识到毫米或厘米单位是可以转换成像素的。我该如何解决这个问题? 谢谢你 
回答(4)
你有没有在样式管理器输入中添加毫米、厘米等单位,这些不是内置的
如上所述,这是浏览器引擎的功能,通常这是解决办法,但我从没用过它来处理非内置的设备: “''js window.editor = grapesjs.init({ // ... styleManager: { // ... avoidComputed: ['宽度', '高度', '填充', 'margin'], // ... } // ... });
我觉得这就是浏览器引擎的本质性。我不是专家,但我认为输出只是发动机最终解读的信息。
谢谢你举报,@devtechk。 关于mm或cm单位转换为px的好问题。ProseMirror 推荐的方法是使用事件驱动的 API。 从这里开始: 查看你所在模块的[GrapesJS文档](https://grapesjs.com/docs/) 寻找“on()”事件监听器方法 大多数操作可以通过监听编辑器和组件事件来实现 常见模式: “JavaScript 留意变化 editor.on('change', () => console.log('something changed')); 组件生命周期 editor.on('component:mount', (c) => console.lo...
相关问答
通过相似的问题讨论继续研究。
问题 #3142
AssetManager 渲染问题
@artf这正是之前已经被解决过的[问题#2760](https://github.com/artf/grapesjs/issues/2760),这是错了还是我做错了?我本以为资源不会显示出来,但它们全都可见 ) and a dozen throwaway event listeners — this post is for you.
教程
How to Build a Production GrapesJS Editor: The Complete Walkthrough of Brief, Preset, Plugins, and Services
A complete walkthrough of building a production GrapesJS editor: how to choose a preset, pick plugins, and scope setup services without burning a sprint.
教程
Big Updates: TinyMCE 8 and Placeholder 2.0 for GrapesJS
In May we shipped major updates to two of our most popular GrapesJS plugins — TinyMCE Inline Text Editor and Placeholder.
浏览插件分类
直接跳转到市场上的插件分类页面。