The CSS in Onsen UI V2 disables list-style-type and list-style to prevent "·" and numbers from appearing, so you can do it by using the CSS counter to swing consecutive numbers yourself.
.list-item_count{
counter-increment:item;
}
.list-item_count div::before{
content:counter(item) ".";
padding-right —10px;
}
<link href="https://unpkg.com/onsenui@latest/css/onsenui.css"rel="stylesheet"/>
<link href="https://unpkg.com/onsenui@latest/css/onsen-css-components.css"rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.6/angular.min.js"></script>
<script src="https://unpkg.com/onsenui@latest/js/onsenui.js"></script>
<script src="https://unpkg.com/onsenui@latest/js/angular-onsenui.js">/script>
<ons-page>
<ons-list class="list_count">
<ons-list-item class="list-item_count">
dog
</ons-list-item>
<ons-list-item class="list-item_count">
cat
</ons-list-item>
<ons-list-item class="list-item_count">
Rabbit
</ons-list-item>
</ons-list>
</ons-page>
© 2024 OneMinuteCode. All rights reserved.