I have a navigation drawer child component inside my parent component. MainComponent.vue Now, in the child component (Navigation drawer), I tried to call a function from the MainComponent by doing: I have a similar parent-child component that calls a function from parent to child, but I don’t know why this one gives me an error saying: TypeError: this.$parent._appendUseris not a
Tag: vue.js
Adding Buttons to a Table created dynamically in vue.js
I am trying to dynamically create buttons which are displayed in the 5th (last) column of a table, which is also created dynamically. Everything is created properly. However, upon clicking the buttons, the function is not triggered. Perhaps it is because I am using vue.js to develop my front-end. I have tried using “v-on:click” instead of “click” in the button.setAttribute(‘click’,
VUE component for Select all option
In my application I have multiple tables on same page (also multiple pages). Each table has “Select all” option and checkboxes in each row. Code reuse would be really helpfull but I cant get this working. Currently I have following methods, but I always get Error in render: “TypeError: Cannot read property ‘includes’ of undefined”. Right now this is code
how to auth user using async and await in firebase
I have a simple app in Vue.js that authenticates existing users in firebase. So far it works but I want to make it using async and await instead of then? How can I rewrite my logic using async and await instead? I looked at the docs but didn’t find any information, here is my code: Answer define the property as
Object(…) is not a function for Vuex Store
I’m in Vue 3, I started with adding a new Vuex.Store to vue, but I continuously get this javascript error. I also tried the same thing with createStore since I use Vue 3, but it’s still the same. What am I missing? Than I add to Vue as store: What am I missing? Complete error Answer If you are using
Vue 3 setup reactive fetch with async json
I’ve installed Vue 3 and want to populate a reactive object with fetch from a JSON API. My component looks like below. I don’t get any errors but I don’t get any results either. I expected to get a number on the screen because that’s what’s in total in the JSON file. On state.test If I only output state.test I
Use of common methods within other Vue components
What is the proper way to use method isValidEmail within compA.vue and some other hypothetical compB.vue? This approach doesn’t work for me: Answer You can simply use mixins: you define in the mixin the function isValidEmail and then you import the mixin in the components you need. https://v2.vuejs.org/v2/guide/mixins.html – Vue v2 https://v3.vuejs.org/guide/mixins.html – Vue v3 For example, instead creating a
Use Vue.js 3 fragments with render function
How should I use Vue 3 fragments with render functions? shouldn’t the following code work? Answer Yes that syntax is correct for defining fragments in render functions : this is equivalent to : LIVE DEMO
How to correctly use Vue 3 composition-api across multiple Vue instances in multiple files
tl;dr What is the correct way to import Vue3 in a base js file, then use Vue’s composition-api in other standalone js files that will be loaded after that base file? I am using Vue to enhance user experience in specific pages. For example, in register page to perform ajax requests and show server errors without page reloads. In short,
Closing a Modal/Menu with the back button in Vue/Nuxt
I want to close a fullscreen menu or modal when the user tap the hardware backbutton. I tried this: but that does not work. Can anyone help me here? Answer For this case, my code is similar with Cosimo’s Answer but with different approach. the difference is i keep the modal triggered by the data property ( this.isMenuOpen ) So