簡體   English   中英

如何對里面的元素進行分組<g>在joint.js 中標記?

[英]How to group elements inside <g> tag in joint.js?

如何使用自定義元素將 rect 等 svg 元素、joint.js 中 g 標簽內的文本分組?

我只需要這樣的東西。

 <g record-group="0" joint-selector="group_0" id="v-225" transform="matrix(1,0,0,1,10,30)">
<g joint-selector="bodiesGroup_0" id="v-222" fill="transparent" stroke="none">
<rect x="-10" y="0" height="20" item-id="value_1" joint-selector="itemBody_value_1" id="v-217" class="record-item-body" stroke="black" width="83"></rect>
</g>
</g>

您可以使用children屬性創建嵌套標記:

var Circle = joint.dia.Element.define('custom.Circle', {
    markup: [{
        tagName: 'g',
        selector: 'wrapper',
        children: [{
            tagName: 'text'
        }]
    }]
});

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM