当前位置:网站首页>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
边栏推荐
- Leetcode-6109: number of people who know secrets
- [rust notes] 17 concurrent (Part 2)
- leetcode-1200:最小绝对差
- Leetcode-556: the next larger element III
- leetcode-31:下一个排列
- [rust notes] 16 input and output (Part 1)
- RGB LED infinite mirror controlled by Arduino
- In depth analysis of for (VaR I = 0; I < 5; i++) {settimeout (() => console.log (I), 1000)}
- Flutter Web 硬件键盘监听
- Open source storage is so popular, why do we insist on self-development?
猜你喜欢
随机推荐
Golang uses context gracefully
Matrixdb V4.5.0 was launched with a new mars2 storage engine!
[rust notes] 13 iterator (Part 2)
SPI 详解
leetcode-31:下一个排列
[rust notes] 17 concurrent (Part 1)
什么是套接字?Socket基本介绍
【Rust 笔记】17-并发(下)
CPU内核和逻辑处理器的区别
Leetcode-31: next spread
SPI details
Sword finger offer II 058: schedule
Overview of variable resistors - structure, operation and different applications
Is it impossible for lamda to wake up?
Open source storage is so popular, why do we insist on self-development?
Shutter web hardware keyboard monitoring
1.13 - RISC/CISC
Regulations for network security events of vocational group in 2022 Guizhou Vocational College skill competition
WordPress switches the page, and the domain name changes back to the IP address
Traversal of leetcode tree







