简体   繁体   English

如何将现有的 Vue.js 2 接口集成到现有的 ASP.NET/C# Web 表单应用程序?

[英]How to integrate an existing Vue.js 2 interface to an existing ASP.NET/C# Web forms application?

Yesterday I've received an interface made using Vue.js 2 and I've been asked to implement it to an existing C#/ASP.NET web forms application.昨天我收到了一个使用 Vue.js 2 制作的界面,我被要求将它实现到现有的 C#/ASP.NET Web 表单应用程序中。

I've noticed that vue.js can be used on the CLI/npm (which I believe the new interface is made of) and the easy import.我注意到 vue.js 可以在 CLI/npm(我相信新界面是由它组成的)和简单的导入上使用。

How should I go about this ?我应该怎么做? A schema of how things will be interacting with each other is appreciated!事物将如何相互作用的模式值得赞赏!

If you have access to the build output of the Vue.js UI it can be quite straight forward in ASP.NET MCV.如果您可以访问 Vue.js UI 的构建输出,那么在 ASP.NET MCV 中它可以非常简单。 I don't now how applicable to webforms it will be but here was my solution to the issue:我现在不知道它将如何适用于网络表单,但这是我对这个问题的解决方案:

@{
    Layout = "~/Views/Shared/Layouts/_Public_Injectable.cshtml";
    ViewBag.Title = "Page Title";
}
@section scripts{
    @Styles.Render("~/content/css/vue")
}

<noscript>
    <strong>We're sorry but this page doesn't work without JavaScript enabled. Please enable it to continue.</strong>
</noscript>

<div id="app"></div>

<script src="~/Scripts/Vue-Build-Files/js/chunk-vendors.738367a5.js"></script>
<script src="~/Scripts/Vue-Build-Files/js/app.40933a0b.js"></script>

Essentially the solution is to take the Vue.JS build output and add it as a set of scripts to the page and ensure that your page has the necessary index.html to work with the vue application本质上,解决方案是将 Vue.JS 构建输出作为一组脚本添加到页面中,并确保您的页面具有必要的 index.html 以与 vue 应用程序一起使用

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将新的MVC C#项目与现有的Web窗体VB.NET Web应用程序项目集成? - How do I integrate a new MVC C# Project with an existing Web Forms VB.NET Web Application Project? ASP.NET MVC 5 向现有应用程序添加角色 w。 表单身份验证 (C#) - ASP.NET MVC 5 Adding roles to an existing application w. Forms authentication (C#) 我可以将 ASP.NET Core MVC 添加到现有的 ASP.NET Web Z645024253191A381C36Z83CAE8 - Can I add ASP.NET Core MVC to existing ASP.NET Web Forms Application 如何为现有的ASP.NET Web应用程序实现页面计数器 - How to implement page counter for an existing ASP.NET web application 如何在 ASP.NET 核心 MVC 中安装使用 C# Winforms 制作的现有 web 服务 - How to install an existing web service made with C# Winforms in ASP.NET Core MVC 如何将Vue.js添加到现有的ASP .NET Core 2.0 MVC项目中? - How to add Vue.js to an existing ASP .NET Core 2.0 MVC project? 如何在asp.net c#mvc中为现有软件创建SaaS应用程序 - How to create a SaaS application for existing software in asp.net c# mvc 将现有的ASP.NET Web窗体应用程序转换为多租户 - Convert existing ASP.NET web forms application to multi-tenancy 将Web服务(ASMX)添加到现有的asp.net表单网站 - Add a web service (ASMX) to existing asp.net forms website 将ASP.NET Core MVC应用程序集成到现有的ASP.NET MVC应用程序中 - Integrate ASP.NET Core MVC Application to existing ASP.NET MVC Application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM