Skip to content

Instantly share code, notes, and snippets.

View SteveJob's full-sized avatar
🚎

Steve SteveJob

🚎
  • Bytedance.Inc
View GitHub Profile
@SteveJob
SteveJob / index.html
Created January 15, 2021 17:59
Thank you! 🎉
<!--
Follow me on
Instagram: https://www.instagram.com/supahfunk/
Dribbble: https://dribbble.com/supahfunk
Twitter: https://twitter.com/supahfunk
Codepen: https://codepen.io/supah/
-->
// 要求 文字框可以输入空格 但首尾空格不计入字数
(rule, value, callback) => {
// value 不是undefined 也不是null
if(value!=null) {
let v = value.trim()
if(v.length>50) {
callback('XXX不能超过50字!')
} else if(v<=0) {
callback('XXX不能为空!')
} else {