重新渲染表获取 json vuejs

时间:2021-02-04 04:29:16

标签: vue.js state vuex render

如何在更新删除或插入操作后呈现表格 我有一个使用以下代码的表格

<tbody>
   <tr v-for="(item, index) in DATASKILL" :key="item.ID">
    <td>{{ index + 1 }}</td>
    <td>{{ item.skills }}</td>
    <td>{{ item.profiency }}</td>
    <td class="text-xs-center">
  </tr>
</tbody>



 export default {
    data: function() {
     return {
       item: {
        skills: "",
        profiency: "",
        idusers : parseInt(localStorage.getItem("userId")),
      },
      };
    },
    computed: {
    DATASKILL() {
        return this.$store.state.skill //call json using axios in store 
      },
    },
    methods:{
     Submited() {
          this.$store
            .dispatch("createSkills", this.item)
            .then((response) => {
              // setTimeout(()=>{
    
              // this.$store.dispatch('getSkill') // load response json use action get in store
              // },2000)
            })
            .catch((error) => {
              error;
            });
        },
     }

当我使用模态表单插入数据时,如何让表格在不刷新的情况下呈现?

0 个答案:

没有答案
相关问题