lwc 画面でのバリデート

下記タグでバリデートエラー時のメッセージ定義できる
https://developer.salesforce.com/docs/component-library/bundle/lightning-input/documentation
VALIDITY ERROR|DEFAULT MESSAGE|ATTRIBUTE TO OVERRIDE DEFAULT
badInput|Enter a valid value.|message-when-bad-input
patternMismatch|Your entry does not match the allowed pattern.|message-when-pattern-mismatch
rangeOverflow|The number is too high.|message-when-range-overflow
rangeUnderflow|The number is too low.|message-when-range-underflow
stepMismatch|Your entry isn't a valid increment.|message-when-step-mismatch
tooLong|Your entry is too long.|message-when-too-long
tooShort|Your entry is too short.|message-when-too-short
typeMismatch|You have entered an invalid format.|message-when-type-mismatch
valueMissing|Complete this field.|message-when-value-missing

カスタマイズしたければ
・jS
get labels() {
return {
badInputLbl:'Enter a valid value.'
};
}

・画面(のlightning-input タグ)
message-when-bad-input={labels.badInputLbl}

とかする。
labelsの値でカスタムラベルから取得して設定するようにすれば
多言語化もできると思う。

Coin Marketplace

STEEM 0.18
TRX 0.13
JST 0.029
BTC 58296.82
ETH 3138.24
USDT 1.00
SBD 2.22