当前位置:网站首页>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

边栏推荐
- SISO decoder for a general (n,n-1) SPC code(补充章节3)
- 剑指 Offer(第 2 版)
- [C语言]用结构体把最高分的学生输出,可有多个最高分
- * Jetpack 笔记 LifeCycle ViewModel 与LiveData的了解
- Common interview questions of network and concurrent programming
- LeetCode_前缀树_中等_208. 实现 Trie (前缀树)
- 牛客刷题——Fibonacci数列
- SISO decoder for a general (n,n-1) SPC code(補充章節3)
- 系统的可扩展型
- 【无标题】
猜你喜欢
随机推荐
Use egg Js+mongodb simple implementation of curdapi
Learn to use LSTM and IMDB comment data for emotion analysis training
v-for中的key的作用和原理
01.电信_领域业务经验
Summary of common mysql/redis interview questions
Various poses for text modification using sed
软件测试技术复习
ACL 2022:评估单词多义性不再困扰?一种新的基准“DIBIMT”
牛客刷题——求最小公倍数
MMA-Self-defining function
LDAP 目录服务器的现代化应用
使用Transformers将TF模型转化成PyTorch模型
[golang] leetcode - 349 Intersection of two arrays (hash table)
合并多棵二叉搜索树
SISO Decoder for Repetition(补充章节4)
The HashSet collection stores student objects and traverses
264 Concepts
论催收系统的管理子系统选型设计
[C语言]用结构体把最高分的学生输出,可有多个最高分
排序的循环链表




![[C语言]限制查找次数,输出次数内查找到的最大值](/img/e6/cbb8dd54b49ade453251a70c8455e8.png)




