kopia lustrzana https://github.com/shoelace-style/shoelace
Add HTMLElement to the getTag() return type
rodzic
b2f6499b87
commit
621aa4362b
|
@ -458,7 +458,8 @@ const App = () => (
|
|||
### Custom Tags
|
||||
|
||||
When multiple options can be selected, you can provide custom tags by passing a function to the `getTag` property.
|
||||
Your `getTag(option, index)` function can return a string or a Lit <a href="https://lit.dev/docs/templates/overview/">Template</a>
|
||||
Your `getTag(option, index)` function can return a string, a Lit <a href="https://lit.dev/docs/templates/overview/">Template</a>,
|
||||
or an HTMLElement.
|
||||
|
||||
```html:preview
|
||||
<sl-select placeholder="Select" value="option-1 option-2" class="custom-tag" multiple clearable>
|
||||
|
|
|
@ -178,7 +178,7 @@ export default class SlSelect extends ShoelaceElement implements ShoelaceFormCon
|
|||
* is the current tag's index. The function should return either a Lit TemplateResult or a string containing trusted HTML of the symbol to render at
|
||||
* the specified value.
|
||||
*/
|
||||
@property() getTag: (option: SlOption, index: number) => TemplateResult | string = option => {
|
||||
@property() getTag: (option: SlOption, index: number) => TemplateResult | string | HTMLElement = option => {
|
||||
return html`
|
||||
<sl-tag
|
||||
part="tag"
|
||||
|
|
Ładowanie…
Reference in New Issue