fix instances.vue

pull/46/head
starsliao 2022-11-17 01:40:41 +08:00
parent a585706b87
commit 4e5aaedc98
1 changed files with 2 additions and 2 deletions

View File

@ -208,7 +208,7 @@ export default {
data() { data() {
const validateInput = (rule, value, callback) => { const validateInput = (rule, value, callback) => {
if (!this.checkSpecialKey(value)) { if (!this.checkSpecialKey(value)) {
callback(new Error('不能含有空格或 [ ]`~!#$^&*=|"{}\':;?')) callback(new Error('不能含有空格或 [ ]`~!#$^&*=|"{}\':;?\\'))
} else { } else {
callback() callback()
} }
@ -317,7 +317,7 @@ export default {
this.inputValue = '' this.inputValue = ''
}, },
checkSpecialKey(str) { checkSpecialKey(str) {
const specialKey = '[]`~!#$^&*=|{}\'":;? ' const specialKey = '[]`~!#$^&*=|{}\'":;? \\'
for (let i = 0; i < str.length; i++) { for (let i = 0; i < str.length; i++) {
if (specialKey.indexOf(str.substr(i, 1)) !== -1) { if (specialKey.indexOf(str.substr(i, 1)) !== -1) {
return false return false