简体   繁体   中英

Yup validation message with  

I'm working with yup, the code I have so far is

   word: yup
    .string()
    .required('word must be 5 characters.')
    .matches(fiveCharacters, 'word must be 5 characters.'),

This works great, but when I try to add a non breaking space between 5 and characters

5 characters

It shows up in the DOM as above instead of being an actual non breaking space. I tried googling around for escape options but couldn't find anything. Thanks

I read somewhere that   is not behaving like normal space. try use this unix code

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM