Created
July 28, 2021 13:21
-
-
Save letswritetw/ff73d6237df2d5bfbc659f70a49354a0 to your computer and use it in GitHub Desktop.
vue3-composition-api-import
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> | |
<div> | |
<ul> | |
<li v-for="u in users" :key="u.id">{{ u.name }}</li> | |
</ul> | |
</div> | |
</template> | |
<script> | |
import getDataFn from '../library/getData'; | |
export default { | |
name: 'HelloWorld', | |
setup() { | |
const { users, getData } = getDataFn(); | |
getData(); | |
return { users } | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment