App.vue
file: code/App.vue
1: <template>
2: <div id="senph">
3: <ShowTopic :topicUrl="topicUrl" />
4: </div>
5: </template>
6:
7: <script>
8:
9: import Vue from 'vue'
10: import axios from 'axios'
11: import VueAxios from 'vue-axios'
12:
13: Vue.use(VueAxios, axios);
14: Vue.config.productionTip = false
15:
16: import ShowTopic from './components/ShowTopic.vue'
17:
18: var App = Vue.extend({
19: name: 'Senph',
20: components: {
21: ShowTopic
22: },
23: data: function () { return {
24: topicUrl: '',
25: }},
26: beforeCreate() {
27: this.axios.defaults.headers.common['Accept'] = 'application/json';
28: },
29: beforeMount() {
30: this.topicUrl = this.$el.dataset.topicUrl;
31: },
32: });
33:
34: export default App;
35:
36: </script>
37: