We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
利用迴圈產生的元件中,index 不會隨著迴圈改變值。
##簡單重現程式碼 :
<v-contextmenu ref="contextmenu" v-on:contextmenu="handleContextmenu"> <v-contextmenu-item v-on:click="AddField(index)">{{index}}</v-contextmenu-item> </v-contextmenu>
文字 [右鍵文字內容] (事件)
1 [1] (AddField(1)) 2 [2] (AddField(2)) ..... ..... 10 [10] (AddField(10))
此時 Contextmenu 的 Index 永遠為1
1 [1] (AddField(1)) 2 [1] (AddField(1)) ..... ..... 10 [1] (AddField(1))
Vue
The text was updated successfully, but these errors were encountered:
ref固定,命中的永远只会是第一个,你或许需要动态绑定ref
Sorry, something went wrong.
No branches or pull requests
問題
利用迴圈產生的元件中,index 不會隨著迴圈改變值。
##簡單重現程式碼 :
期望结果
文字 [右鍵文字內容] (事件)
1 [1] (AddField(1))
2 [2] (AddField(2))
.....
.....
10 [10] (AddField(10))
实际结果
此時 Contextmenu 的 Index 永遠為1
文字 [右鍵文字內容] (事件)
1 [1] (AddField(1))
2 [1] (AddField(1))
.....
.....
10 [1] (AddField(1))
环境说明
Vue
版本: 2.6.11The text was updated successfully, but these errors were encountered: