I’m trying to attach a simple character counter to an input element but the second I display it back to the user, the input breaks in that I’m unable to enter any additional characters in the input box. To summarize the code above, I’m doing some basic cleansing on change, and am looking to trigger a character count on key
Tag: vue.js
How to use function that return value inside a template? Vuex, Vue
I’m using a template to get data of a json file, I use “v-for” to print all data, for example: But I need use functions, year() to modificate this information and return and result, for example: The value {{ item.date }} print “2021-01-20” but I hope print “2021” using the function {{ year(item.date) }} Code function year() using javascript: I
ECONNREFUSED when dispatch action in nuxtServerInit
I am converting my Nuxt application to SSR – because I want to use nuxtServerInit and asyncData. These are the steps I have taken to convert it. Remove ssr: false from nuxt.config.js Dispatch actions to initialize store’s state in nuxtServerInit inside store/index.js Now my nuxt.config.js looks like this And the store/index.js looks like this. But after I restarted the development
VueJS – call function in external JS file directly from Template
Let’s say that in a VueJS project, I have a HelloWorld.js file like this: And it’s used from HelloWorld.vue like this: My agony comes from having to ‘duplicate’ the addNumbers function in the methods section of the HelloWorld component. Is there a simple way to make the external addNumbers function available from the template section? Answer you could export as
limited number of dynamic generated images by using vue
I wanted to make a div of random positioned icons and this is what i made so far. Can we make this to generate only limited number of images like 20 images and not unlimited. If you have better way to make something like this, then i would be really thankful. Thanks Answer Introduce variables for the total, the current
vue-router beforeEach function does not return item which is updated
I’m stuck with a problem. So here is the scenario. I put an axios request which takes the access token from cookies on store. Then I committed a mutation to make true isLoggedIn variable. Then I access this variable from Navbar to change menu items. It works. But when I try to access isLoggedIn variable with getters in beforeEach function,
How to use a method on page load? VueX
I’m learning Vue with Vuex, I made a method called ‘llamarJson’this method get a json data. I don’t know how to use it when the page load. I tried many ways but I could not find a solution. I’m using Vue and Vuex. Please, could you help me? That’s the code html: That’s the JS code: Answer you should use
did you register the component correctly? For recursive components, make sure to provide the “name” option. (found in ) VUE
I’m learning Vue with Vuex, I tried to do a component but appear this error: vue.js:634 [Vue warn]: Unknown custom element: actividadescomponent – did you register the component correctly? For recursive components, make sure to provide the “name” option. (found in ) error screen shot I tried many ways but I could not find a solution. That’s the code html:
Vue add new value to array
I am new to VUE and for one project I am trying to update an array passing the object. I have two button which is called BUTTON 1 and BUTTON 2. If you click on BUTTON 1 then it will set an object to list[] using this.$set. But when BUTTON 2 is pressed it should update with the new value
How can I change the value of an item in an array based on multiple conditions?
I am trying to change the value of an item in array, based on matching other items in the array. The array might contain details of the section (non-unique), a unique ID, and a value I wish to change (in this case a ‘selected’ flag). The goal is to be able to have multiple items which can have their selected