0

I am new to vue and in process of learning this.

First Question - I am trying to read values from webconfig to vue, so instead of hardcoding directly in vue file I can use value from web config. Can someone tell me how can I do this?

Second Question - How do i debug vue code? I am using in C# mvc project and I installed vue.js devtools extension for chrome. But I am trying to understand, how can i put breakpoint and step through like how we do in normal C# project? Is it possible in vue? Any useful links for debugging vue would be really grateful.

Thanks in advance.

2 Answers 2

1

First question: for you to get values from the web.config file (server side) to your vue files (client side), you'll need an api call to retrieve the values from the server, i.e. your web.config file. Just like you'd retrieve any other data.

Second question: debugging your vue app should be the same as debugging any other javascript application/file. The basics are: press F12 in Chrome, go to the sources tab and find the file you want to debug (alternatively press ctrl+p and find the file), then you can place a breakpoint on the left hand side where the numbers are. Alternatively, you can also put a debugger within your code, which will then be hit if you have Chrome dev tools open. An example of this debugger would look like:

someFunction()
{
    //breakpoint will be hit at this debugger
    debugger;
}

Take a look at this and this link which should help you get started on debugging javascript in Chrome.

Hope this helps!

Sign up to request clarification or add additional context in comments.

1 Comment

This helps for sure. Cheers
0

For your first question: You can read webconfig value in mvc view and put that value in Javascript's window object. Then you can read value from Vue.That s how I read webconfig values in my angularjs project.

1 Comment

Thank you. Appreciate it

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.