How to write a custom component and use it?
-
Hello
iam really new to this quasar and vue world…
so evenutally its so easy i just don’t know jet…i have started my app with the getting-started guide with the CLI install
now after some time playing around with various things
(see https://github.com/s-light/quasar_test)
i want to create a new component to use in one of my page files.
so i created a file at
src/components/CanvasTextRender.vue
and tried to use it in
src/pages/font.vuebut it seems i missing something basic…
and i don’t know how to search for a tutorial or similar info on this…hope someone can push me in the right direction…
sunny greetings
stefan -
Hi Stefan,
We recommend beginners to Vue and Quasar learn the basics of Vue first. Once you get that down, you’ll understand how to implement your own components in Quasar.
Here is the course: https://www.udemy.com/vuejs-2-the-complete-guide
Scott
-
Hello s-light,
You need to register the component. Check out how Quasar docs do it (this is global registration, but you can do it locally too): https://github.com/quasarframework/quasar/blob/dev/docs/src/boot/components.js
And the VueJS documentation for it: https://vuejs.org/v2/guide/components-registration.html
-
Thanks Scott & lucasfernog!
i have read the Vue-beginners guide… and are happy to play-around and learn from the documentation
(if i find the correct part)
the link to the example boot/components.js is great!
→ that was the missing point
and the components-registration thing was the doc i searched for!
seems i have to search also more in the Vue documentation!!
especially Local-Registration-in-a-Module-System did it for meThanks! - now it works!
sunny greetings
stefan