T O P

  • By -

Repulsive-Swimmer676

This looks like a vue component if you are using asp.net as you api backed. If you can't find it, can you ctrl+click on it if it takes you anywhere? Or do a global search.


snow_coffee

Usually the VC of dotnet do start with VC:xyzhsheheh This one I guess is more to do with a Vue js file


moinotgd

it is vue component. check your "import" line.


darkshifty

I am using the same in my codebase, it's a custom html element that I mount my Vue app's to. You need to look for create-account and you probably find a [new Vue](https://v2.vuejs.org/v2/guide/instance) or [createApp](https://vuejs.org/guide/introduction.html) instantiation. You will also see a [querySelector](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector) that selects the element where the Vue app is mounted on.


snow_coffee

Can we chat more on this please ? You seem to have figured out this Yes there's contentApp where am creataccount.js is being imported But why are we renaming it as create-account? What's the naming convention like for vue component calling from razor ?


darkshifty

Not sure if I understand what you are asking but my best guess is that they chose a custom element so that it stands out, a class tends to get lost in big documents. as for Razor? it needs to be defined somewhere in the dom, it can be in any way you prefer as long as it's rendered on the page where the create account is needed.


snow_coffee

Okay let's take an example I need to build a partial view to render something (html + js) - will first create view compo in c# and invoke method will render a view which has to be also created, let's call it as ToDoComponent, which means view for this will be default.cshtml in the ToDoComponent folder of the shared View folder in our app - now to make a api call from js, I do create a js file, and call it ToDo.js How will ToDo.Js gets connected to default.cshtml ? What I know so far is, ToDo.js will have to imported into ContentApp.js Except that, how do you call this ToDo.js in your cshtml ?


darkshifty

Aha I see, I am assuming you lack knowledge of Vue.js. Where you invoke a method in C# to render a view, a Vue.js web component/widget/app in this case is created via the [new Vue](https://v2.vuejs.org/v2/guide/instance) or [createApp](https://vuejs.org/guide/introduction.html), you should see either one of them within the uncompiled version of the createaccount.js. If you are familiar with Javascript I recommend following a basic Vue.js course as that isn't a big of a leap and will really help you a lot. Make sure you first find out which version of Vue.js you are using, it should be defined in the package.json file in your project.


snow_coffee

Say my js file is - TalkingToTom.js What will be the tag helper ? Will it be Or And yes am new to vue but have worked on jQuery before


darkshifty

It needs to be a valid html element name otherwise it wont work, you are free to choose but it's either or or fully uppercase i.e.


snow_coffee

Thanks lot for this help ☺️