Skip to content

Instantly share code, notes, and snippets.

@pureexe
Last active August 31, 2017 13:23
Show Gist options
  • Select an option

  • Save pureexe/09908b6f3eef045e8fabef02c726cc4d to your computer and use it in GitHub Desktop.

Select an option

Save pureexe/09908b6f3eef045e8fabef02c726cc4d to your computer and use it in GitHub Desktop.
<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