Advertisement
Guest User

Untitled

a guest
Dec 12th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <template>
  2.     <div v-if="committee_id > 0">
  3.         <a
  4.             href="#"
  5.             class="line-btn blue"
  6.         ><span>Return to the section's committees list</span></a>
  7.         <h2>{{ data.title }}</h2>
  8.         <div
  9.             v-html="data.content"
  10.         ></div>
  11.         <div class="btn-cnt">
  12.             <a
  13.                 href="#"
  14.                 class="curve-btn blue"
  15.                 @click.prevent="goBack"
  16.             ><span>Join the committee</span></a>
  17.         </div>
  18.         <div class="roster detail-roster">
  19.             <h3>Committees Roster</h3>
  20.             <div class="row">
  21.                 <div class="col-xs-6">
  22.                     <p :class="{classArray:name}">Amanda Alvarado</p>
  23.                 </div>
  24.             </div>
  25.         </div>
  26.     </div>
  27. </template>
  28.  
  29. <script>
  30.     import {EventBus} from '../event-bus';
  31.     import axios      from 'axios';
  32.  
  33.     export default {
  34.         data() {
  35.             return {
  36.                 classArray: {
  37.                     name: 'name',
  38.                     title: 'title',
  39.                 },
  40.                 committee_id: 0,
  41.                 data: [],
  42.                 api_url: (API.restUrl !== undefined) ? API.restUrl : '',
  43.             };
  44.         },
  45.         created() {
  46.             EventBus.$on('committee-post-id', committee_id => {
  47.                 this.committee_id = committee_id;
  48.                 this.getCommitteePost();
  49.             });
  50.         },
  51.         methods: {
  52.             getCommitteePost: () => {
  53.                 this.$nextTick(function () {
  54.                     axios.get(`${this.api_url + this.committee_id}`)
  55.                          .then(({data}) => {
  56.                              if (data.message === 'success') {
  57.                                  this.$nextTick(function () {
  58.                                      this.data = data;
  59.                                  });
  60.                              }
  61.                          })
  62.                          .catch(err => {});
  63.                 });
  64.             },
  65.             goBack: () => {
  66.  
  67.             }
  68.         },
  69.         name: 'section-committee'
  70.     };
  71. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement