grapesjs - GrapesJs 链接组件不可调整大小
问题描述
我正在扩展葡萄 js 的链接组件,但即使在给出之后
resizable: 1,
droppable: 1,
我不能调整它的大小,也不能在里面放任何东西。图书馆里还有什么我需要改变的吗?
我的组件代码是-
const linkType = domc.getType('link');
const model = linkType.model;
const view = linkType.view;
domc.addType('link', {
model: model.extend({
defaults: {
...model.prototype.defaults,
resizable: 1,
editable: 1,
droppable: 1,
traits: [
{
type: 'text',
name: 'test',
label: 'Text',
},
...model.prototype.defaults.traits,
],
},
isComponent: function (el) {
if (el.tagName == 'A' || el.tagName == 'LINK') {
return { type: 'link' };
}
},
}),
view: view,
});
解决方案
推荐阅读
- javascript - 浏览器扩展禁用 JavaScript 以获取客户端 IP 地址
- python - 列表理解仅在一个索引中访问列表中的嵌套列表
- vue.js - 有没有办法设置mixin数据?
- reactjs - 反应选择标签:第二个选择标签选项值取决于第一个选择标签选择的值
- javascript - 如何从缓存中加载不同的文件?
- api - 重新渲染 Vue JS 组件
- java - spark提交java.lang.IllegalArgumentException:无法从空字符串创建路径
- forms - Puppeteer:单击网站上的按钮不起作用
- android - 如何在 Jetpack 中的 ModelDrawer 布局中添加 FloatingActionButton 组合在 android
- asp.net-core - NewtonsoftJsonInputFormatter 在 .NET5 中不能用作 InputFormatter