<gux-list-legacy>
<gux-list-item-legacy value="test" text="test"></gux-list-item-legacy>
<gux-list-divider-legacy></gux-list-divider-legacy>
<gux-list-item-legacy value="test2">Some detail</gux-list-item-legacy>
<gux-list-item-legacy
text="test3"
value="test3"
disabled
></gux-list-item-legacy>
<gux-list-item-legacy value="test4">
<div>
<gux-icon
class="example"
icon-name="user-add"
decorative="true"
></gux-icon>
Add User
</div>
</gux-list-item-legacy>
</gux-list-legacy>
<script>
Array.from(document.querySelectorAll('gux-list-item-legacy')).forEach(
item => {
item.addEventListener('press', notify);
}
);
</script>
Steps:
- Replace the
gux-list-legacy
tag name withgux-list
- <gux-list-legacy>
+ <gux-list>
- </gux-list-legacy>
+ </gux-list>
- Replace the
gux-list-item-legacy
tag name withgux-list-item
- Slot text content.
gux-list-item
has notext
property likegux-list-item-legacy
. All content must be slotted withingux-list-item
. - Pass 'value' information to your
click
handler directly.gux-list-item
has novalue
property likegux-list-item-legacy
gux-list-item
has no custompress
event likegux-list-item-legacy
. You must use aclick
event ongux-list-item
.
- Slot text content.
- <gux-list-item-legacy text="Test"></gux-list-item-legacy>
+ <gux-list-item>Test</gux-list-item>
- Replace the
gux-list-divider-legacy
tag name withgux-list-divider
- <gux-list-divider-legacy>
+ <gux-list-divider>
- </gux-list-divider-legacy>
+ </gux-list-divider>
Completed V4 Migration:
<gux-list>
<gux-list-item onclick="notify(event, 'test')">Test</gux-list-item>
<gux-list-divider></gux-list-divider>
<gux-list-item onclick="notify(event, 'test2')">Some detail</gux-list-item>
<gux-list-item onclick="notify(event, 'test3')" disabled>Test3</gux-list-item>
<gux-list-item onclick="notify(event, 'test4')">
<div>
<gux-icon
class="example"
icon-name="user-add"
decorative="true"
></gux-icon>
Add User
</div>
</gux-list-item>
</gux-list>