【问题标题】:Meteoric Autoform change label typeMeteoric Autoform 更改标签类型
【发布时间】:2015-12-08 22:54:50
【问题描述】:

也许我只是愚蠢地正确阅读了文档,但我目前正在使用流星.js 的流星包(离子集成)。

有控制表单的“meteoric:autoform-ionic”包。我想更改由以下代码生成的表单的标签类型:

{{> quickForm collection="Todos" id="insertTodosForm" type="insert" template="ionic" }}

软件包的文档没有那么有用。他们说:

支持多种标签类型:内联标签(默认)占位符 标签('label-type': 'placeholder', placeholder: 'Label Here') 堆叠标签 ('label-type': 'stacked') 浮动标签 ('label-type': 'floating', placeholder: 'Label Here')

我不知道如何将它集成到我的模板中。

有谁熟悉这个?

【问题讨论】:

    标签: javascript meteor ionic-framework meteoric


    【解决方案1】:

    文档似乎暗示您使用#autoForm 并为每个字段应用标签类型和占位符。

    我无法证明这一点,但这里有一个例子

    {{#autoForm collection="Todos" id="insertTodosForm" type="insert" template="ionic" }}
        {{> afQuickField name='name' label-type="floating" placeholder="Name" }} 
        {{> afQuickField name='priority' label-type="floating" placeholder="Priority" }}
    {{/autoForm}}
    

    【讨论】:

      【解决方案2】:

      您必须将其包含在您的 SimpleSchema 中,例如:

      name: {
          type: String,
          label: "name",
          autoform: {
            'label-type': 'stacked'
          },
          optional: true
        },
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2018-03-12
        • 1970-01-01
        • 2016-08-08
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2023-03-06
        相关资源
        最近更新 更多