Skip to content
Advertisement

Tag: vue-component

Use that was imported in the parent

I’m building a component that manages other components. It dynamically render components in specific places depending on the props and inputs, much like an orchestrator. Use case My orchestrator have the following placeholders, like a grid (p1 … p6): In a given moment, it renders the component C1 into p2 and C2 into p6: In another moment, it replaces the

How to define variable in vue template?

Problem I have the need to temporarily store the results of a method call in Vue templates. This is particularly common inside loops, where I cannot easily use computed properties. Javascript snippet: To improve performance, I really need a variable to store the method call result. What is the Vue way to solve this problem? Answer A quick way to

vue.js insert block for every 6th loop element

I have offers cards list rendering thru the loop. Every 3rd col (bootstrap) elements i add row div. Now i need to add another col element (banner block) for every 6th element. For render some thing like that: How i can implement that? My code now Answer I would recommend you do less programming in the view and more in

Cannot call a function inside mounted()

I have a chat API that I’m connecting to a Vue.js project. When user goes to a chat room page, it sends an ajax request and then calls the function that fetches the whole chat history: but it fails with: TypeError: _this.fetchChatSessionHistory is not a function I understand that it might be defined at a wrong place but I have

access method outside vue component

i am new in vuejs. i have created comment feature similar with here, but due to certain circumstances i have to improvise it. i use vue component but it couldn’t access method inside my vue. if user has already post comment, any user may be able to reply that particular comment. however, i received vue warn “Property or method ‘replyComment’

How to save data in Vue instance

The question is quite simple, All I want is to get the data after the AJAX post saved in Vue instace’s data. Here is my code: And after I trigger the getUserAcc(id) method,I try to verify the VMList.user value in browser console,and I get only the id.Seems like after the function is over the data is reset.How could I store

vue.js component inline style concatenation

I’m stuck with a vue.js component inline style concatenation. My code is the following: I’m trying to get procolors.user.profile_background_color as inline background color. Special is that the value from procolors.user.profile_background_color has no #. So I have to add this in the template. I tried all kinds of recommendations from the web, but none worked for me. Any help appreciated! Answer

Advertisement