vue-iconz | 3000 Icons for Vue | Frontend Framework library
kandi X-RAY | vue-iconz Summary
kandi X-RAY | vue-iconz Summary
(wip) 3000+ Icons for Vue
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of vue-iconz
vue-iconz Key Features
vue-iconz Examples and Code Snippets
Community Discussions
Trending Discussions on vue-iconz
QUESTION
I have a BaseMenuItem component that has normal button elements as well as special news elements. I have added a ticker effect to the news type els and want to stop the ticker on that element when it's clicked. Currently the click event stops the ticker effect on the whole group.
How can I target a single element from that group?
There are two methods, openNews
one showing the specific news article that the element is linked to.
And clearItemType
that clears the itemType
upon recieving the emitted event from the BaseMenuItem component.
I'm just not sure which element to target to change it's itemType
.
Does Vuejs have a way to make an unique data value for dynamically generated elements?
If you need anymore information please let me know!
Cheers!
BaseMenuItem
...ANSWER
Answered 2021-Apr-22 at 19:53EDIT: I edited since your latest comment. See below
To target the exact element within your v-for
that fired the event, you can use $refs
by using an index :
QUESTION
I have a MainMenuItem
that has a bunch of static titles. There is one variable item that is for news and events and that has a horizontal ticker, scroll animation on it. This animation is happening inside of the MainMenuItem
component, but the click event will be happening from the parent. The click event currently needs to stop the animation and change the font weight (can be seen in the readLink
class).
Wth Vue I cannot mutate the prop type itself with something like @click="itemType = ''"
.
So how can I turn this ticker animation off on click?
Basically, all I would need to do is make the MainMenuItem
's itemType = ''
and make it the same as every other item. Do I need to make a data type? Or a click event that $emit's an event to the child/base component MainMenuItem
?
If there is anymore code that is necessary please let me know!
Cheers!
MainMenuItem.vue (base component with the ticker animation )
...ANSWER
Answered 2021-Apr-19 at 15:06Since it's a prop the simplest way is to emit an event that executes what you need in the parent and also bind a variable not static prop to be able to change it. example in the child :
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install vue-iconz
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page