I recently delved into the world of Vue.js and VueMaterial, which has been a refreshing and new experience for me since I've mostly focused on Native Android development in the past.
Currently, I'm facing an unusual issue that seems to stem from my limited understanding of the framework's lifecycle.
The Problem
Upon manually loading or refreshing the project in Chrome for the first time, the VueMaterial components fail to load, resulting in the following error message:
Unknown custom element: md-toolbar - did you register the component correctly? For recursive components, make sure to provide the "name" option.
This error occurs with every VueMaterial component I incorporate in the project, such as md-whiteframe, and md-input-container.
Here is how it looks: https://i.sstatic.net/Gu6PY.png
If I manually change the URL to access a different component, some components display correctly (excluding the toolbar). Upon returning to the initial component, everything shows up as expected except for the toolbar.
Occasionally, completely randomly, the Toolbar displays correctly.
https://i.sstatic.net/DCGKM.png
Background Details
To give context, I used vue-cli via npm and built the project with the webpack template. Additionally, I installed VueMaterial using npm.
Code Snippets
Below are excerpts from the code base.
main.js
[Vue configurations]
App.vue
[App component code]
Toolbar.vue
[Toolbar custom component code]
Login.vue
[Login component code]
router.js
[Router configuration]
--
Despite being new to web development, I decided to explore Vue.js due to its positive reputation. However, I seem to be struggling with why the components don't load initially but work fine upon revisiting the page...
In addition, the router-link in Login.vue doesn't seem to function when clicked, which might be a separate issue altogether.
Any insights or feedback on the provided code would be greatly appreciated so I can enhance it further.
The complete codebase is accessible on GitHub, if that would assist in troubleshooting.
Thank you!