diff --git a/src/main.js b/src/main.js index d395fba..e5a2ea6 100644 --- a/src/main.js +++ b/src/main.js @@ -17,7 +17,7 @@ import { defineRule, configure } from 'vee-validate' -import all from '@vee-validate/rules' +import * as all from '@vee-validate/rules' import allValid from '@/utils/validate' import '@/assets/style/global.scss' import '@/assets/style/icon.scss' @@ -34,7 +34,9 @@ configure({ validateOnModelUpdate: true // controls if `update:modelValue` events should trigger validation with `handleChange` handler }) Object.keys(all).forEach(rule => { - defineRule(rule, all[rule]) + if (typeof all[rule] === 'function') { + defineRule(rule, all[rule]) + } }) Object.keys(allValid).forEach(rule => { defineRule(rule, allValid[rule]) diff --git a/vue.config.js b/vue.config.js index 2419ca3..0d4d42e 100644 --- a/vue.config.js +++ b/vue.config.js @@ -79,5 +79,9 @@ module.exports = { headers: { 'Access-Control-Allow-Origin': '*' // 解决跨域问题 } - } + }, + transpileDependencies: [ + 'birpc', + '@vue/devtools-kit' // 如果仍然报错,把上游也加上 + ] } \ No newline at end of file