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

边栏推荐
- Surveillance des fonctions de perte avec visdom
- 在同花顺上面开股票账户好不好,安不安全?
- Is it good or not to open a stock account on the flush? Is it safe?
- NFT platform development NFT mall source code NFT mall development chain game development
- Async leads to unexpected function results and changes the intention of the original code; await is only valid in async functions and the top level bodies of modules
- Sword finger offer (2nd Edition)
- 高性能架构设计
- RadioGroup动态添加RadioButton
- ACL 2022:评估单词多义性不再困扰?一种新的基准“DIBIMT”
- 判断是否为平衡二叉树
猜你喜欢
随机推荐
Various poses for text modification using sed
Understanding of distributed transactions
谈谈远程工作 | 社区征文
5分钟了解攻防演练中的红蓝紫
Monitoring loss functions using visdom
Getting started with CTF
Learn to use LSTM and IMDB comment data for emotion analysis training
MySQL/Redis 常见面试题汇总
On the problem that the while loop condition in keil does not hold but cannot jump out
Apipost精妙使用技巧
SISO Decoder for SPC (补充章节1)
[C语言]限制查找次数,输出次数内查找到的最大值
PIL-Pillow图像处理【1】-安装与新建
LeetCode_前缀树_中等_208. 实现 Trie (前缀树)
使用Transformers将TF模型转化成PyTorch模型
金融银行_催收系统简介
Is it good or not to open a stock account on the flush? Is it safe?
VIM common commands
* Jetpack 笔记 LifeCycle ViewModel 与LiveData的了解
ISCSI详解(四)——ISCSI服务端配置实战








