【问题标题】:when i'm using vuelidate library in quasar 2 get this error当我在 quasar 2 中使用 vuelidate 库时出现此错误
【发布时间】:2021-07-07 07:48:59
【问题描述】:

Vue 未定义。 client-entry.js?2f39:103 [Quasar] 启动错误:TypeError: Cannot read property 'use' of undefined.

这是我的启动文件代码。

import Vuelidate from 'vuelidate'
import Vue from 'vue'
export default ({ Vue }) => {
  Vue.use(Vuelidate)
}

【问题讨论】:

    标签: quasar vuelidate


    【解决方案1】:

    Quasar 2 使用 vue3。

    
    import { boot } from 'quasar/wrappers';
    import Vuelidate from 'vuelidate'
    
    export default boot(({ app }) => {
      app.use(Vuelidate);
    });
    

    现在,这个答案假设 Vuelidate 支持 Vue3。如果没有,这将不起作用。

    【讨论】:

    • 是的,我也试过这个,然后在我使用 vuelidate 进行验证时它给出了参考错误。 Uncaught (in promise) ReferenceError: process is not defined
    • 您阅读文档了吗? vuelidate-next.netlify.app
    • 感谢特伦特,这个参考文档解决了问题。
    猜你喜欢
    • 2020-02-10
    • 2013-05-20
    • 2019-09-22
    • 1970-01-01
    • 2021-12-28
    • 1970-01-01
    • 1970-01-01
    • 2021-04-03
    • 2017-10-10
    相关资源
    最近更新 更多