問題描述:
蘋果手機,接收驗證碼之后,有一個直接粘貼得功能,但是有個bug 就是,接收得驗證碼會復制一遍,粘貼上是重復的
解決辦法:
(1)進行字符串的截取
<input id="Ucode" class="code" type="text" placeholder="請輸入驗證碼" oninput="if(value.length>6)value=value.slice(0,6)">
(2)input 有個maxlength 屬性
<input v-model="phone" class="phone_inp" type="text" maxlength="6" placeholder="請輸入驗證碼" @input="get_phone">