未显示的选择动态元素是positalizecss模态

发布于 2025-01-31 19:25:44 字数 1097 浏览 5 评论 0 原文

当我尝试添加选项元素以在Svelte中选择“ sevelte”,“选择”选择不显示元素。我在

list and also I can see the elements in the console/elements window. Non dynamically added the elements displays perfectly. Why is it?

模态代码样本:

<div id="modal1" class="modal modal-fixed-footer" style="overflow: hidden; width: 80%">
  <div class="modal-content">
    <h4>Add a new locationName</h4>
    <select>
      <option value="" disabled selected>Choose your option</option>
      <option value="1">Option 1</option>
      <option value="2">Option 2</option>
      <option value="3">Option 3</option>
    </select>
    <select bind:value={locationName.languageId} label="label goes here">
      {#each languages as listItem}
        <option value={listItem.id}>
          {listItem.name}
        </option>
      {/each}
    </select>
    <ol>
      {#each languages as listItem}
        <li>{listItem.name}</li>
      {/each}
    </ol>
  </div>

When I try to add options element to select in Svelte, using materializecss, the select shows no elements. I listed the exported option elements (the binded data) in a

list and also I can see the elements in the console/elements window. Non dynamically added the elements displays perfectly. Why is it?

The modal code sample:

<div id="modal1" class="modal modal-fixed-footer" style="overflow: hidden; width: 80%">
  <div class="modal-content">
    <h4>Add a new locationName</h4>
    <select>
      <option value="" disabled selected>Choose your option</option>
      <option value="1">Option 1</option>
      <option value="2">Option 2</option>
      <option value="3">Option 3</option>
    </select>
    <select bind:value={locationName.languageId} label="label goes here">
      {#each languages as listItem}
        <option value={listItem.id}>
          {listItem.name}
        </option>
      {/each}
    </select>
    <ol>
      {#each languages as listItem}
        <li>{listItem.name}</li>
      {/each}
    </ol>
  </div>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

孤蝉 2025-02-07 19:25:44

很可能问题不是物质化,因为它只是一个样式库。我的怀疑是您所提供的数据缺少某些字段。
请参阅此补充,并检查您是否正在提供相同的模式。

Most probably the issue is not with materialize as it's just a styling library. My suspect is the data you are providing is missing some fields.
Please refer to this REPL and check if you are providing the data with same schema.
https://svelte.dev/repl/cba91d7ceb6c4ae48c9c2ace8f916be9?version=3.48.0

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文