Last active
April 22, 2020 03:38
-
-
Save mrkmiller/a55e18513b9b3a59210962d98f2d31f1 to your computer and use it in GitHub Desktop.
Vue/React loop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function BasicLoop(props) { | |
| const items = props.items; | |
| return ( | |
| <ul> | |
| {items.map((value, index) => { | |
| return <li key={index}>{value}</li> | |
| })} | |
| </ul> | |
| ) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <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