Level 73
42
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Following code results in auto addition in total value
<script setup>
import { ref } from 'vue'
const list = ref([1, 2, 3])
const itemRefs = ref([])
let t=0;
function total(id){
t += id;
return t;
}
</script>
<template>
<ul>
<li v-for="item in list">
{{ total(2) }}
</li>
</ul>
</template>
Please or to participate in this conversation.