毫米或厘米单位转换为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),这是错了还是我做错了?我本以为资源不会显示出来,但它们全都可见 ![图片](https://user-images.githubus...
问题 #3504
我注意到有人使用了 font awesome 4.7 的早期版本。
我注意到有人使用了 font awesome 4.7 的早期版本。 我使用 fontawesome 5.2 版本,似乎在与 Grapes JS 版本同时加载时会出现问题,有些字体无法加载,或者新 fontawesome 字符集中的类名发生了变化。 我该如何使用 Fontawes...
问题 #3254
如何在 traitManager 中隐藏“.gjs-traits-label”?
也许你能帮帮我......我想在打开 TraitManager 时移除标签“.gjs-traits-label”。 ![图片](https://user-images.githubusercontent.com/2309686/106330419-f499c500-6261-1...
问题 #3154
在打开图层管理器中点击眼睛图标时隐藏元素
我想看到代码处理事件隐藏或删除元素。我在哪里能找到它? <img width=“958” alt=“Capture” src=“https://user-images.githubusercontent.com/56115755/99949266-509d2480-2dad-1...
与此问题匹配的付费插件
根据问题关键词和标签相关性精选,助你更快交付。
正在加载付费插件推荐……
相关教程
关于同一主题的深入指南。
教程
How to Build an AI-Powered Page Builder with GrapesJS in 2026
What we learned building GJSDocs — from simple AI text generation to structured, context-aware visual editing
教程
How Much Does It Cost to Build a SaaS Page Builder in 2026?
How much does it cost to build a SaaS page builder in 2026? Explore realistic development costs, timelines, features, and how using GrapesJS can reduce
教程
PageKit: the GrapesJS application you'd have to build anyway
A source-available Next.js app around the open-source GrapesJS core — publishing, custom domains, leads, checkout and a plugin loader.
浏览插件分类
直接跳转到市场上的插件分类页面。