Ember-Drag-Sort:自定义HTML元素

时间:2018-08-24 00:07:14

标签: ember.js ember-drag-sort

是否可以为.dragList指定自定义元素标签?在我现在的场景中,我需要将其设置为<article> <div class="bignumber"><em>High treason</em></div> <div class="clause">Any person who abrogates or subverts or suspends or holds in abeyance, or attempts or conspires to abrogate or subvert or suspend or hold in abeyance, the Constitution by use of force or show of force or by any other unconstitutional means shall be guilty of high treason.</div> <div class="clause">Any person aiding or abetting or collaborating the acts mentioned in clause (1) shall likewise be guilty of high treason.</div> <div class="subclause">An act of high treason mentioned in clause (1) or clause (2) shall not be validated by any court including the Supreme Court and a High Court.</div> <div class="clause">Majlis-e-Shoora (Parliament) shall by law provide for the punishment of persons found guilty of high treason.</div> <div class="subclause">Here is a subclause that should be 3A.</div> <div class="subclause">Here is a subclause that should be 3B.</div> <div class="clause">And now on to 4 and beyond....</div> </article>,因为我正在渲染包裹在<ul>内的商品-试图避免创建叉子。

类似这样的东西...

<li>

我们可以渲染传入的tagName,而不是默认为列表渲染a,这也很高兴能够传递父列表的自定义类

1 个答案:

答案 0 :(得分:2)

您可以配置drag-sort-listdrag-sort-item组件的标签名称:

{{#drag-sort-list
  tagName      = "article"
  childTagName = "section"
}}

tagName内置在每个Ember组件中。

childTagName在插件的readme中进行了描述。