use $index in component
See original GitHub issueHi , i have a component <image-upload></image-upload>
but i used it in v-for
so i need to send the current index to component to use it when dispatch event , so how could i use something like <image-upload index="{{ $index }}"></image-upload>
?
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How do index.js files work in React component directories?
An index.js file allow you to import (or require() ) its parent folder as a module. This behavior is copied from Node.
Read more >How to use index.js file(Properly) - DEV Community
this can be solved by using the index. js file only to export. import React from 'react'; const SomeComponent = () => {...
Read more >This or that? Component Names: index.js or ... - Brad Frost
The idea of this approach is to have Component.js contain the guts of the component, while index.js merely imports that component file and ......
Read more >Managing Z-Index In A Component-Based Web Application
Within a component's CSS file, maintain z-index values any way you like. It might be consecutive values, or you could give them a...
Read more >Importing React Components using Index.js - Default Export
Hey'll; This is Happy; Welcome back to the New Coding Recipe; By using the index.js we will import the components as an object...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
First, define a prop called
index
inside<image-upload>
that accepts a Number (you can give it another name if you’d like), Then, pass the index using<image-upload :index="index"></image-upload>
Please read more about components and passing props here: http://vuejs.org/guide/components.html#Passing-Data-with-Props
Hi, thanks for filling this issue, however the issue tracker is reserved for bug reports and feature requests only, so please use our dedicated gitter or forum to ask questions.
There is a section in the guide explaining this: http://vuejs.org/guide/list.html
Please avoid using $index as it’s deprecated in 2.0