当前位置:网站首页>V-for loop traversal
V-for loop traversal
2022-06-11 18:26:00 【Hello, teacher I'm Dabai】
v-for Loop traversal
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style> .active{
color: red; } </style>
</head>
<body>
<div id="app">
<h2> World wide cat animation </h2>
<ul>
<li v-for="(item, index) in movies" :class="{active: currentIndex === index}" @click="liClick(index)">
{
{item}}
</li>
</ul>
</div>
<!-- from CDN introduce vue.js-->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
<script> const app = new Vue({
// Initialize a VUE example el: '#app', // For page rendering VUE Element of instance data: {
// Defining data movies: [' One man fixes the immortals ', ' Break the vault of heaven ', ' The moon in Qin Dynasty ', ' The heart of the sword ', ' Young song line '], currentIndex: 0 }, methods: {
liClick(index) {
this.currentIndex = index } } }) </script>
</body>
</html>

Browser effect display

边栏推荐
- Sorted circular linked list
- [c language] limit the number of searches and output the maximum value found in the number of internal searches
- On the problem that the while loop condition in keil does not hold but cannot jump out
- 炫酷的可视化工具:processing 初识
- SQL报错注入1
- ctfhub-sql布尔盲注
- H. 264 concept
- 力扣23题,合并K个升序链表
- 学习使用LSTM和IMDB评论数据进行情感分析训练
- 谈谈远程工作 | 社区征文
猜你喜欢

软件测试技术复习
![[c language] output the students within the specified score range with the structure](/img/40/cbd7fe5aafbaeb6237e6d257455e5e.png)
[c language] output the students within the specified score range with the structure

DC-DC自举电容(BOOT)几个问题
![[c language] limit the number of searches and output the maximum value found in the number of internal searches](/img/e6/cbb8dd54b49ade453251a70c8455e8.png)
[c language] limit the number of searches and output the maximum value found in the number of internal searches

网络和并发编程常见面试题

New work of "the father of LSTM": a new method towards self correcting neural network
![[golang] leetcode - 292 Nim games (Mathematics)](/img/82/54c3f6be9d08687b42cba0487380f0.png)
[golang] leetcode - 292 Nim games (Mathematics)

Say no to credit card fraud! 100 lines of code to realize simplified real-time fraud detection

H.264概念

【无标题】
随机推荐
Use egg Js+mongodb simple implementation of curdapi
力扣32题最长有效括号
HashSet集合
Various poses for text modification using sed
[c language] shift elements after sorting elements of an array
了解一下random库·1
初识企业级平台
谈谈远程工作 | 社区征文
使用mysql判断日期是星期几
General terms in security field
Experiment 3: design and verify all operations represented by linear table sequence on the computer
[golang] leetcode - 292 Nim games (Mathematics)
[Golang]力扣Leetcode - 292. Nim 游戏(数学)
ISCSI详解(四)——ISCSI服务端配置实战
Implementation of servlet file upload function (Commons fileUpload)
判断是否为平衡二叉树
求字符串中最大的 3 位相同数字
[c language] compress strings and add markup characters
[C语言]对一个数组的元素排序后平移元素
牛客刷题——求最小公倍数