4 ms·
> Also, both of your examples are missing `key`, though React will warn you about it and Vue will not Vue will warn when you're missing a key on the loop. >Th
by ROARosen 5y ago
> Also, both of your examples are missing `key`, though React will warn you about it and Vue will not
Vue will warn when you're missing a key on the loop.
>That requires you to create 2 new components (which unlike React, will need to be in separate files if you're using SFCs)
Your components don't need to be in separate files even when using SFC's.
Given 'component' can be as simple as adding to any Vue Component or SFC (when adding it to parent component option):
<script>
const myComponent = {
props: ['myProps'],
template: `
<div></div>
`
}
</script>