Have this code: I handle the focus perfectly, but want to run the method goToSlug() on key enter be pressed. It doesn’t fire the method. Answer Key presses are only registered on items that have focus. In order to make an element like a <li> tag focusable (which natively does not have that ability) you will need to add another
Tag: vuejs3
How to import Library into Vue3 project
could someone help me import a library to my vue3 project so that I can use it in all components?… I’am trying to import ‘moments.js’ to my project Its installed with npm in my ‘main.js’ (entry) I import it like: but when I try to console.log(this.moment) from another component I get errors that this.moment is not a function Answer For
How to dynamically import Vue 3 component?
According this article I would like to import component to view dynamically to my Vue 3 app. The code of the view looks like: Code does not throw any errors but I dont see the component on the page. If I use first import style it works. Am I missing somethig? Answer You need to use defineAsyncComponent in Vue 3
Vue js send data from api to new page
I am new to Vue Js and I would like to know how I can send data between two components. I am building a vue app that gets a list of users from an api and displays them. I would like to know I can move data between two components so that I can view more details on a new
_firebase_config__WEBPACK_IMPORTED_MODULE_3__.default.createUserWithEmailAndPassword is not a function in Vue Js
createUserWithEmailAndPassword function is not working for me. Below are my code – config.js useSignUp.js Tried a number of things- Delete node modules and install them again. Change the version of firebase as well Nothing working for me any solutions are appreciated. Thanks in Advance!! Answer when you importing the config.js file inside useSignUp.js you are setting the whole object as
Petite-vue Init attribute in HTML script tag
I recently saw this Vue.js snippet by Evan You on Twitter, and I don’t understand what the init attribute in the script tag does. I could not find anything about this on MDN or similar sites. The defer attribute is clear to me. Answer It’s explained in the repo Readme file in the Usage section : The init attribute tells
How can I move directives from main.js into an external file Vue 3
I would like to have a clean main.js and for this I want to move the directives into an external file. That is, to do something like and in an external file My version of course does not work, how to do it correctly Answer define them in a separate file like : then import them in main.js and loop
Currency Converter function in Vue3
I’m trying to implement a convert() function in a Vue3 project. I have a functions.js file to store some “global” basic functions I’m calling the function inside a component like this But it doesn’t work properly, I only get a pending Promise result… Can anybody tell me what I’m doing wrong? I’m learning Vue and JS…. Answer There is two
How Do I Use an Import Function in a Vue 3 Template?
In a Vue 3 project, I have the following setup. There is a separate stuff.ts file with some helper functions in it and I want to use it in my template. As far as I can tell, the function is properly imported and it’s defined when I log it in onMounted(). But when I click the link and try to
Vue 3 component not updating after call from vue-router
I want to build a todo app with ionic-vue. It currently uses vue 3. I have this overview (called Lists.vue) where it is possible to click on multiple lists (where tasks should be loaded per list). However, everytime when I click on a list, the same data appears! It is as if the component is being reused but not re