[Vuejs]-Issue when using v-bind to update star value in semantic ui using vue.js rendering

1đź‘Ť

This issue is now resolved. Apparently what I did was that i inserted the semantic ui’s “.ui.rating” function in my vue method just after the axios api call. So it means that after my axios.get is executed then my “.ui.rating” calls gets initialized everytime when I call loadmore.

new Vue({
    el: '#vue-app',
    delimiters: ['[[', ']]'],
    data: {
      dino: d_var,
      infox: [],
      isHidden: false
    },
    methods: {
      loadmore: function () {
        axios.get(this.dino)
          .then(response => {
            this.infox.push(...response.data);
            this.dino = "/api/search/" + this.infox[this.infox.length - 1].lid;
            kk = this.infox[this.infox.length - 1].gr;
            jj = ("true" == kk);
            this.isHidden = jj;
          })
          .then(function () {
            $('.ui.rating')
              .rating({
                initialRating: 3,
                maxRating: 5
              });
          })
      }
    },

  })
👤fear_matrix

Leave a comment