Last active
November 5, 2018 16:27
-
-
Save ohiosveryown/29e0e5feabf15225b8f994ce6e7c48da to your computer and use it in GitHub Desktop.
Object Array for Vue
This file contains 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> | |
<main> | |
<h1>{{ object.first }} {{ object.last }}</h1> | |
<p>{{ object.age }}</p> | |
</main> | |
</template> | |
<script> | |
export default { | |
name: 'HelloWorld', | |
data: function() { | |
return { | |
object: { | |
first: 'John', | |
last: 'Doe', | |
age: '24' | |
}, | |
another: { | |
first: 'Jimmer', | |
last: 'Ferdette', | |
age: '30' | |
} | |
} | |
} | |
} | |
</script> | |
// before | |
// data: function() { | |
// return { | |
// item: { | |
// title: '', | |
// description: '', | |
// } | |
// } | |
// }, | |
// after | |
// data: () => ({ | |
// item: { | |
// title: '', | |
// description: '', | |
// } | |
// }), |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment