Skip to content

Instantly share code, notes, and snippets.

@mrkmiller
Last active April 22, 2020 03:38
Show Gist options
  • Select an option

  • Save mrkmiller/a55e18513b9b3a59210962d98f2d31f1 to your computer and use it in GitHub Desktop.

Select an option

Save mrkmiller/a55e18513b9b3a59210962d98f2d31f1 to your computer and use it in GitHub Desktop.
Vue/React loop
function BasicLoop(props) {
const items = props.items;
return (
<ul>
{items.map((value, index) => {
return <li key={index}>{value}</li>
})}
</ul>
)
}
<template>
<ul>
<li v-for="item in items">
{{ item }}
</li>
</ul>
</template>
<script>
export default {
props: ['items']
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment