chore: fix eslint warning

This commit is contained in:
Clark Du 2019-02-18 10:44:03 +00:00
parent 4a44496481
commit b9391d7ea0
6 changed files with 20 additions and 20 deletions

View File

@ -18,6 +18,9 @@ function getRandomColor() {
}
export default {
components: {
DoughnutChart
},
async asyncData({ env }) {
const res = await axios.get(`https://api.github.com/repos/nuxt/nuxt.js/stats/contributors?access_token=${env.githubToken}`)
return {
@ -32,9 +35,6 @@ export default {
]
}
}
},
components: {
DoughnutChart
}
}
</script>

View File

@ -10,6 +10,9 @@ import axios from 'axios'
import moment from 'moment'
export default {
components: {
BarChart
},
async asyncData({ env }) {
const res = await axios.get(`https://api.github.com/repos/nuxt/nuxt.js/stats/commit_activity?access_token=${env.githubToken}`)
return {
@ -24,9 +27,6 @@ export default {
]
}
}
},
components: {
BarChart
}
}
</script>

View File

@ -28,14 +28,14 @@
import { mapState } from 'vuex'
export default {
computed: mapState([
'counter'
]),
// fetch(context) is called by the server-side
// and before instantiating the component
fetch({ store }) {
store.commit('increment')
},
computed: mapState([
'counter'
]),
methods: {
increment() {
this.$store.commit('increment')

View File

@ -15,14 +15,14 @@
import { mapState } from 'vuex'
export default {
computed: mapState([
'counter'
]),
// fetch(context) is called by the server-side
// and nuxt before instantiating the component
fetch({ store }) {
store.commit('increment')
},
computed: mapState([
'counter'
]),
methods: {
increment() {
this.$store.commit('increment')

View File

@ -21,6 +21,9 @@
import socket from '~/plugins/socket.io.js'
export default {
watch: {
'messages': 'scrollToBottom'
},
asyncData(context, callback) {
socket.emit('last-messages', function (messages) {
callback(null, {
@ -29,9 +32,6 @@ export default {
})
})
},
watch: {
'messages': 'scrollToBottom'
},
beforeMount() {
socket.on('new-message', (message) => {
this.messages.push(message)

View File

@ -6,15 +6,15 @@
<script>
export default {
asyncData() {
return {
[Math.random()]: true
}
},
computed: {
debug() {
return JSON.stringify(this.$data, null, 2)
}
},
asyncData() {
return {
[Math.random()]: true
}
}
}
</script>