How do I use ons-input correctly?

Asked 1 years ago, Updated 1 years ago, 81 views

Maybe it's just the wrong way to look at the document, but if you specify class="text-input" for ons-input and also specify the placeholder attribute, the characters you specify for placeholder will appear double.Is it right to use these two at the same time?Is it wrong?I can't tell if it's a problem.Ver.2 may have caused confusion in the information on the site, but I would like to know how to use it correctly.

onsen-ui

2022-09-30 19:23

1 Answers

ons-input does not require a class to be specified.
If you use the input tag, specify the class.

<ons-list>
    <ons-list-item>
        <ons-input type="email" placeholder="ons-input">/ons-input>
    </ons-list-item>
    <ons-list-item>
        <input type="email" class="text-input --material"placeholder="input+text-input --material">
    </ons-list-item>
    <ons-list-item>
        <input type="email" class="text-input" placeholder="input+text-input">
    </ons-list-item>
    <ons-list-item>
        <input type="email" placeholder="none">
    </ons-list-item>
</ons-list>

Example Run


2022-09-30 19:23

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.