【问题标题】:Get selectedOptions on sl-select with Shoelace.style使用 Shoelace.style 在 sl-select 上获取 selectedOptions
【发布时间】:2022-10-25 11:50:55
【问题描述】:

我有一个来自 Shoelace.style 的 <sl-select> 元素。

我在我的脚本中选择了它,但与原生 <select> 不同,它似乎没有 selectedOptions 属性。

有替代方案吗?或者我怎样才能从中获得 selectedOptions ?

我在这里有什么选择?

【问题讨论】:

    标签: shoelace


    【解决方案1】:

    您可以通过检查 sl-select 组件上的 value 属性来实现相同的目的。

    这是它工作的demo

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-03-05
      • 1970-01-01
      • 2020-08-30
      • 2019-10-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多