Skip to content

Instantly share code, notes, and snippets.

@phptechs
Created December 30, 2023 11:25
Show Gist options
  • Save phptechs/1adcec82341b1809a409c10701bde614 to your computer and use it in GitHub Desktop.
Save phptechs/1adcec82341b1809a409c10701bde614 to your computer and use it in GitHub Desktop.
temp 5
<script setup>
import { ref } from "vue"
const user = {
id: 1,
name: "John Smith",
type: "user",
}
</script>
<template lang="pug">
div(v-for='(n, i) in 5')
| {{ n }} --- {{ i }}
br
div(v-for='(value, key) in user')
| {{ key }} --- {{ value }}
// Result:
1 --- 0
2 --- 1
3 --- 2
4 --- 3
5 --- 4
id --- 1
name --- John Smith
type --- user
</template>
<style lang="scss" scoped>
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment