node.js下载地址 https://nodejs.org/en/download/ 安装完成后 找到 Node.js command prompt 打开即为node的命令窗口 执行命令 npm install -g @vue/cli 查看vue版本 vue --version 创建一个新项目 vue create hello-world 运行项目 npm run serve 打包项目 npm run build 打包之后得到dist文件夹 可以将打包的发布到IIS 参考 https://www.jianshu.com/p/7cc266438f09
新建net core项目 nuget 安装 Microsoft.AspNetCore.SpaServices 2.11 VueCliMiddleware 2.11 把 hello-world项目复制到core项目根目录 public void ConfigureServices(IServiceCollection services) { services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); services.AddSpaStaticFiles(configuration => { configuration.RootPath = \"hello-world/dist\"; }); } app.UseSpa(spa => { spa.Options.SourcePath = \"hello-world\"; if (env.IsDevelopment()) { spa.UseVueCli(npm : \"serve\", port: 8080); // optional port } });
直接运行项目即可 访问 http://localhost:8080/ 就是你的core项目啦
继续阅读与本文标签相同的文章
上一篇 :
SQLServer之创建不可重复读
下一篇 :
负载均衡原理的解析
-
关闭Windows休眠功能,删除 hiberfil.sys 文件,腾出可用空间 - Windows 10
2026-05-19栏目: 教程
-
快照技术使用
2026-05-19栏目: 教程
-
受用一生的高效 PyCharm 使用技巧(六)
2026-05-19栏目: 教程
-
用户数从 0 到亿,我的 K8s 踩坑血泪史
2026-05-19栏目: 教程
-
PgSQL · 特性分析 · 浅析PostgreSQL 中的JIT
2026-05-19栏目: 教程
