0

正如您从标题中看到的那样,我尝试更改占位符文本,上面写着“没有结果匹配”并且从选定的标签中显示为灰色(禁用)。

我尝试使用“占位符”,但它不起作用。

<div>
    <select chosen disable-search="true" id="newpaymentMethod"
            placeholder="Placeholder text"
            class="easytrade-input full-width" name="newpaymentMethod"
            ng-model="vm.newRecord.paymentMethod"
            ng-options="paymentMethod.type as paymentMethod.description
                for paymentMethod in vm.paymentMethodOptions"
            required>
    </select>
</div>

然后我尝试使用“no_results_text”,仍然无法正常工作

<div>
    <select chosen disable-search="true" id="newpaymentMethod"
            no_results_text="Placeholder test"
            class="easytrade-input full-width" name="newpaymentMethod"
            ng-model="vm.newRecord.paymentMethod"
            ng-options="paymentMethod.type as paymentMethod.description
                for paymentMethod in vm.paymentMethodOptions"
            required>
    </select>
</div>

有什么想法吗?谢谢

4

1 回答 1

1

在我检查了Angular-Chosen的 GitHub 文档后,我发现了如何使用“no_result_text”。

请看下面的代码:

<div>
    <select chosen disable-search="true" id="newpaymentMethod"
            no-results-text="'Placeholder test'"
            class="easytrade-input full-width" name="newpaymentMethod"
            ng-model="vm.newRecord.paymentMethod"
            ng-options="paymentMethod.type as paymentMethod.description
                for paymentMethod in vm.paymentMethodOptions"
            required>
    </select>
</div>

所以你必须使用“no-results-text”而不是“no_results_text”,并且文本应该用''换行,就像下面的“'text here'”

希望能帮助别人我的回答:)

于 2018-09-11T12:58:56.587 回答