shawnwildermuth / vueincore Goto Github PK
View Code? Open in Web Editor NEWSample Using Vue in ASP.NET Core Project
Sample Using Vue in ASP.NET Core Project
Hi @shawnwildermuth thanks for this blog post, really like the approach and it is very helpful.
Do you know if this is possible with Vite? From what I can see you must have an index.html file as well as main.js for each page that you want to create a separate bundle/page section for. Looking at the rollup options for Vite: https://vitejs.dev/config/build-options.html#build-rollupoptions, it does not seem this is possible in the same way as the Pages variable as used for vue.config.ts?
I am looking for a way to use the razor cshtml files as the launching point for each page and then a "mini-spa" on each main razor page (so I can use ASP.NET antiforgery token for example, and any other razor goodies...)
Do you have any advice on how to do that?
Thanks.
Just looking for your opinions in doing something like this with Vue 3. With easier support on SSR rendered pages in vue 3 without nuxt now I'm not sure how viable a solution like this would be with Vue 3, IMO.
Hi!
Couldn't leave comment/question with article anymore, so I'm asking here .....
How do I include proper vue scripts (npm build)
<script src=/js/chunk-vendors.6ef87ee7.js></script>
<script src=/js/index.9d28a0e2.js></script>
in the razor page
@page
@model IndexModel
@{
ViewData["Title"] = "Home page";
}
@section Scripts {
<script src="~/app/js/chunk-vendors.js"></script>
<script src="~/app/js/index.js"></script>
}
<div id="app"></div>
My main purpose to use your approach would be to be independent of basepath during vue build,
use app.UsePathBase("/optionalpath") and inject it as global js variable...
Thanks and Best Regards,
Stefan
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.