我的项目正在使用 QuillJS。我正在尝试添加自定义类属性。我希望我的链接能够没有类名,或者类名“自定义链接”。阅读此处的文档https://github.com/quilljs/parchment#class-attributor我编写了以下代码:
const Parchment = Quill.import('parchment');
const CustomLinkClass = new Parchment.Attributor.Class('custom-link', 'custom-link', {
scope: Parchment.Scope.INLINE
});
Quill.register(CustomLinkClass, true);
Run Code Online (Sandbox Code Playgroud)
但是,当我插入<a class="custom-link" href="https://google.com">Hello</a>编辑器时,类名被删除。有人可以帮忙吗?
这里有一个 Quill Playground 示例:https ://codepen.io/anon/pen/qoPVxO
我正在尝试实现下图所示的列布局。我需要
如果没有足够的孩子组成一个新列,其他列应不填满水平空间,就像这样:
https://jsfiddle.net/qLx7sun1/
.parent {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
/*flex-direction: column;
height: calc(20px * 11);*/
}
.parent div {
flex: 1 0 31%;
max-width: 31%;
background: grey;
height: 20px;
margin-bottom: 1rem;
}
Run Code Online (Sandbox Code Playgroud)
这是我到目前为止所拥有的;但是,子级将父级填充为行而不是列。如果我取消注释,flex-direction: column;那看起来真的很奇怪。我也没有设法获得交替行的背景。
我可以通过CSS / flexbox实现此功能还是必须使用Javascript?