Skip to content

在文档块的 DOM 中添加文档块属性 #4117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Zuoqiu-Yingyi opened this issue Feb 27, 2022 · 0 comments
Closed

在文档块的 DOM 中添加文档块属性 #4117

Zuoqiu-Yingyi opened this issue Feb 27, 2022 · 0 comments
Assignees
Milestone

Comments

@Zuoqiu-Yingyi
Copy link
Contributor

在什么情况下你需要该特性? In what scenarios do you need this function?

主题中一些文档级的样式(例如标题自动编号)需要使用文档块自定义属性启动/关闭, 但是目前文档块的 div 标签中没有文档块属性, 因此无法使用 CSS 属性选择器设置样式

描述可能的最优解决方案 Describe the optimal solution

在内容块的上一级文档块 data-doc-type="NodeDocument" 中设置如下块自定义属性

<div
    class="protyle-wysiwyg protyle-wysiwyg--attr"
    spellcheck="false"
    contenteditable="true"
    data-doc-type="NodeDocument"
    data-node-id="..."
    bookmark="..."
    name="..."
    alias="..."
    memo="..."
    custom-attribute="..."
>
@88250 88250 added this to the 1.8.6 milestone Mar 1, 2022
@88250 88250 changed the title 在文档块的DOM树中添加文档块属性 在文档块的 DOM 中添加文档块属性 Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants