Vue.js Wait for a Child Component to Mount

Search for a command to run...

No comments yet. Be the first to comment.
In this series, expect some detailed blogs on useful snippets or coding procedures that I find useful for my day-to-day life as a web developer!
Tdlr; I had put automated integration testing on the back burner due to "lack of time" but once I saw how easy it was - I felt rather silly for taking so long. Try out Cypress! You might be as surprised as I was! I am not sponsored in any way in thi...
In the world of web development using C#, the Response.Redirect method is a common way to guide users to different pages within a web application. However, there's a glaring issue that we need to address: the second parameter, which introduces unnece...

Ever need to trap the focus of the browser to a modal, a tour guide, or something else while trying to balance accessibility? I am far from an expert, but one thing I found on StackOverflow that helped me was this snippet from Shane McCurdy from th...

The Intro We had a dilemma today of an issue found in our code that needed to be fixed. After some time hunting I was able to find a distinct "this is good" reference in time and a distinct "this is not good" reference - but had no idea which commit ...

Before I Start You can find the podcast episode around this topic below! Introduction I shall begin with a quick story of something I went through this past week. I had a task to create analytics events for a few new key features that we wanted to ...

Ideally - we want our components to be kinda "dumb". Mostly just displaying data or gathering input from the user - the front end components shouldn't be smart enough to know what to do with said info once they have it.
Usually this means we need to tell another portion of the app to handle more complex stuff. Be it Vuex to handle connecting to our API or to manage our data state that is read by other "dumb" components.
Today I learned a new thing, and that is how to listen to a child component's mounted lifecycle method before doing something.
<CustomComponentName @hook:mounted="onChildComponentMount()"/>
methods: {
onChildComponentMount() {
console.log('CustomComponentName mounted!');
}
}
My take away today is this:
If it feels harder than it should be - you're probably doing it wrong.
Is this new to you too? Let me know in the comments!