Last active
August 31, 2017 13:23
-
-
Save pureexe/09908b6f3eef045e8fabef02c726cc4d to your computer and use it in GitHub Desktop.
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> | |
| <div> | |
| <main> | |
| <md-list > | |
| <md-list-item v-for="bot in bots" :key="bot.id" :href="'#/bot/'+bot.id"> | |
| {{bot.name}} | |
| </md-list-item> | |
| </md-list> | |
| <md-button class="md-fab md-fab-bottom-right" @click="add"> | |
| <md-icon>add</md-icon> | |
| </md-button> | |
| </main> | |
| </div> | |
| </template> | |
| <script> | |
| import bot from '@/models/bot' | |
| export default { | |
| data: () => { | |
| return { | |
| bots: [ | |
| {name: 'test', id: 0} | |
| ] | |
| } | |
| }, | |
| methods: { | |
| add: () => { | |
| } | |
| }, | |
| created: () => { | |
| let self = this | |
| bot.list().then((botList) => { | |
| // ตรงนี้ botList มีค่าออกมา | |
| self.bots = botList | |
| }) | |
| } | |
| } | |
| </script> | |
| <style scoped> | |
| </style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment