v-for
ts styles for individual elements
v-for
mponent can loop through a bunch of components. However, when styling, there is a need for individual elements to be styled in such a way that they are highlighted.
<card-grid
style="width:25%; text-align: center"
v-for="(item,i) in menuItems"
:key="i"
ref="items"
:style="i === itemIndex ?chosenStyle:'' "
>
{{ item.name }}
</card-grid>
itemIndex code> as needs to be individually styled sequence, when the
I code> render time and
itemIndex code> is equal, this component will be separately set a
: style = 'chosenStyle' code>, can achieve the corresponding effect.
Read More:
- valueError: Length mismatch: Expected axis has 40 elements, new values have 38 elements
- Vue element admin configure global styles
- Several ways to center elements horizontally and vertically
- Python uses the priority queue to get the maximum k elements
- Remove array duplicate elements
- Selenium: 8 Ways to Locate Elements
- Python random selects elements randomly from a collection
- ArcGIS import database elements error 000210
- Solve the unmarshalling error: unexpected element (URI: “local:” name “). Expected elements are
- [Vue warn]: Do not use built-in or reserved HTML elements as component id: article
- During the development of vue, v-for reported an error [vue/require-v-for-key] Elements in iteration expect to have’v-bind:key’ directives.
- JQuery is a solution to the disappearance of listening events after adding elements with append
- After JQ gets the tag element itself, it gets its own HTML text format (find only finds one level of child elements)
- Declarative development tab in Vue
- Attempted import error: ‘injectglobal’ is not exported from ‘styled components’
- Research on invalid modification of elementui component style
- CSS: several ways to center the box vertically and horizontally
- How to center the box horizontally and vertically in HTML
- Solving ora-21561: oid generation failed
- How to distinguish the source channel of router.push jump fast application