Composables in Templates #6398
braitsch
started this conversation in
General Discussions
Replies: 1 comment 2 replies
-
I would guess you need to return the function from your setup function also for the template to see it... so basically setup() {
return { toTitleCase }
} |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, how do you use a composable function within a template? For example, I have a
toTitleCase
composable that I want to use to transform a string that's dynamically rendered within a template. The following errors outTypeError: _ctx.toTitleCase is not a function
. Here's my setup:and within my Vue file:
In Vue2 I could use a mixin to accomplish this and that would be available within the template but composables aren't? Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions