How to call Adonis hook function in Vue JS?



Usually you just call adonis hook function by :

{{ formatPrice(x.amount) }}

But now, I am using Vue in edge, how to call this?

@{{ formatPrice(x.amount) }}

will call the Vue function inside method, not Adonis hook anymore

Thanks! Hope my question is understandable


I believe you are talking about the global functions. Nope, you cannot write functions in Edge and run them inside Vue and neither it makes any sense. Simply create methods in Vue instead


Yes, global functions.
I see, I just don’t want to repeat doing the same things in Vue methods section

Thanks btw @virk :+1:


Yeah, but code sharing is not possible and neither it’s as simple as it sounds.

Also if you are using Vue, you should keep all of your views inside it and simply don’t use Edge, mixing them again is not a nice idea


Yeah, I mainly use Edge. The Vue JS is only like cherry on top (like jQuery addition)


You can use Vue.js filters but as @virk stated. You should write your logic in the frontend again.