当前位置:网站首页>Nested method, calculation attribute is not applicable, use methods
Nested method, calculation attribute is not applicable, use methods
2022-07-05 06:17:00 【hamimelon2020】
<template>
<div>
<ul v-for="numbers in sets" :key="numbers.id">
<li v-for="n in even(numbers)" :key="n">{
{
n }}</li>
</ul>
</div>
</template>
<script>
export default {
name: 'item',
data() {
return {
sets: [[ 1, 2, 3, 4, 5 ], [6, 7, 8, 9, 10]]
}
},
methods: {
even(numbers) {
return numbers.filter(number => number % 2 === 0)
}
}
}
</script>
even() even numbers
边栏推荐
- MySQL advanced part 1: stored procedures and functions
- 【Rust 笔记】15-字符串与文本(上)
- Single chip computer engineering experience - layered idea
- LeetCode 0107. Sequence traversal of binary tree II - another method
- Shutter web hardware keyboard monitoring
- MySQL advanced part 2: SQL optimization
- [rust notes] 17 concurrent (Part 1)
- One question per day 2047 Number of valid words in the sentence
- Redis publish subscribe command line implementation
- SQLMAP使用教程(一)
猜你喜欢
Liunx starts redis
LeetCode 0107. Sequence traversal of binary tree II - another method
Network security skills competition in Secondary Vocational Schools -- a tutorial article on middleware penetration testing in Guangxi regional competition
Single chip computer engineering experience - layered idea
Sqlmap tutorial (II) practical skills I
1.14 - 流水线
Leetcode-6110: number of incremental paths in the grid graph
数据可视化图表总结(一)
Groupbykey() and reducebykey() and combinebykey() in spark
MIT-6874-Deep Learning in the Life Sciences Week 7
随机推荐
One question per day 1020 Number of enclaves
1.13 - RISC/CISC
做 SQL 性能优化真是让人干瞪眼
Appium automation test foundation - Summary of appium test environment construction
阿里巴巴成立企业数智服务公司“瓴羊”,聚焦企业数字化增长
leetcode-22:括号生成
Navicat连接Oracle数据库报错ORA-28547或ORA-03135
leetcode-6111:螺旋矩阵 IV
LeetCode 0108. Convert an ordered array into a binary search tree - the median of the array is the root, and the left and right of the median are the left and right subtrees respectively
SPI 详解
Overview of variable resistors - structure, operation and different applications
Appium基础 — 使用Appium的第一个Demo
Operator priority, one catch, no doubt
One question per day 1765 The highest point in the map
高斯消元 AcWing 884. 高斯消元解异或线性方程组
leetcode-6109:知道秘密的人数
leetcode-1200:最小绝对差
884. Uncommon words in two sentences
Leetcode dynamic programming
LVS简介【暂未完成(半成品)】