I have a project that requires the client side to use Vue.js to render application views, but on the server side it is intended to use ASP.NET MVC Core to validate all business rules.
Is there a way to integrate both technologies?
I have a project that requires the client side to use Vue.js to render application views, but on the server side it is intended to use ASP.NET MVC Core to validate all business rules.
Is there a way to integrate both technologies?
Hello, one way would be to use asp.net core to serve as a rest api, and use the vues only for a front end, in my opinion is the best way.
The simplest and least "malicious" way is to pass the object's JSON to the view.
For example:
<script>
var app = new Vue({
el: '#clienteForm',
data: @Json.Serialize(Model)
})
</script>
Now your object Vue
has all the model data
The other option is to make your vue do ajax requests for a WebAPI that returns the object's JSONs.