Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. app.js
  2. /**
  3. * First we will load all of this project's JavaScript dependencies which
  4. * includes Vue and other libraries. It is a great starting point when
  5. * building robust, powerful web applications using Vue and Laravel.
  6. */
  7.  
  8. window.Vue = require('vue');
  9.  
  10. /**
  11. * The following block of code may be used to automatically register your
  12. * Vue components. It will recursively scan this directory for the Vue
  13. * components and automatically register them with their "basename".
  14. *
  15. * Eg. ./components/ExampleComponent.vue -> <example-component></example-component>
  16. */
  17.  
  18. // const files = require.context('./', true, /.vue$/i)
  19. // files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default))
  20.  
  21. import Vue from 'vue';
  22. import VueRouter from 'vue-router';
  23. import routes from './routes';
  24.  
  25.  
  26. import '../../node_modules/nprogress/nprogress.css';
  27.  
  28. const axios = require('axios');
  29.  
  30.  
  31. Vue.use(VueRouter);
  32.  
  33.  
  34.  
  35. const app = new Vue({
  36. el: '#app',
  37.  
  38. data: function() {
  39. return {
  40. outputs: []
  41. }
  42. },
  43.  
  44.  
  45. mounted() {
  46. axios.get('/api/output')
  47. .then((response) => {
  48. this.outputs = response.data;
  49. console.log(this.outputs);
  50. })
  51. .catch((err) => {
  52. console.log(err);
  53. });
  54.  
  55.  
  56.  
  57. },
  58.  
  59. router:new VueRouter(routes),
  60.  
  61. });
  62.  
  63. Outputs.vue
  64. <template>
  65. <div><div class="text-grey-darkest font-normal uppercase text-3xl font-bold leading-none mb-3">Outputs</div>
  66. <ul>
  67. <li v-for="(journal_id) in outputs" v-text="journal_id"></li>
  68.  
  69. </ul>
  70. </div>
  71. </template>
  72.  
  73. <script>
  74.  
  75. export default{};
  76. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement