如何在MVC中导入Javascript模块?

根据Vuelidate Basic Usage,我正在尝试在MVC和Vue JS中使用Vuelidate,我需要:

import Vue from 'vue'
import Vuelidate from 'vuelidate'

我写了

bundles.Add(new ScriptBundle("~/bundles/vuelidate").Include(
       "~/node_modules/vuelidate/dist/vuelidate.min.js"));

@Scripts.Render("~/bundles/vuelidate")

确保已导入Vuelidate,并且可以在源代码中看到vuelidate.min.js,但是,当尝试编写Vue.use(Vuelidate)时,出现控制台错误:

ReferenceError: Vuelidate is not defined

我跳过了import Vue from 'vue'import Vuelidate from 'vuelidate',因为我认为它们已经通过使用bundle和render导入了。那么如何在MVC中正确导入Vuelidate?

liaoyi1107 回答:如何在MVC中导入Javascript模块?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3159070.html

大家都在问