类 CmsDictionaryDataListDirective

所有已实现的接口:
Directive, HttpDirective, freemarker.template.TemplateDirectiveModel, freemarker.template.TemplateModel

@Component public class CmsDictionaryDataListDirective extends AbstractTemplateDirective
dictionaryDataList 数据字典数据列表

上下文变量

  • lang:语言

参数列表

  • dictionaryId:字典id,为空时返回空结果
  • parentValue:父节点值

返回结果

使用示例

<#assign lang="cn"/> <@cms.dictionaryDataList dictionaryId='data'><#list list as a>${a.text}<#sep>,</#list></@cms.dictionaryDataList>

<script>
 fetch('${site.dynamicPath}api/directive/cms/dictionaryDataList?dictionaryId=1&parentValue=text',{"headers":{"lang":"cn"}}).then(res => res.json()).then(data=>{
   console.log(data);
 });
 </script>
 
  • 字段详细资料

  • 构造器详细资料

    • CmsDictionaryDataListDirective

      public CmsDictionaryDataListDirective()
  • 方法详细资料

    • execute

      public void execute(RenderHandler handler) throws IOException, freemarker.template.TemplateException
      参数:
      handler -
      抛出:
      IOException
      freemarker.template.TemplateException