Vue mobile project (implementation of functions that are not of interest to the feedback panel)

Achievement and requirements:

Clicking not interested can prompt whether it is successful or not

When the if is judged to be equal to "not interested", let the method in it use the method of passing the parent from the child, pass the parameter in the method of this.$emit in AeitivleItem.vue, and pass the id

 In the parent component is used to receive the value of the child component

 request data in api

 The method of introducing api in Ariticlelist.vue

 Request data in methods

   //顶部刷新事件方法
    async onRefresh() {
      // 目标: list 数组 清空,来一份新的数据

      this.list = [];
      this.theTime = new Date().getTime();

      this.getAriticleListFn();
    },
    // 反馈, 不感兴趣
    async disLikeFn(id) {
      console.log(id);
      const res5 = await dislikeArticleAPI({ artId: id });
      console.log("反馈", res5);
      // 成功通知
Notify({ type: 'success', message: '反馈成功' });
    },
  },

No matter whether the request data succeeds or fails, a prompt is required to introduce the Notify component

 

import { Notify } from 'vant';

Finally, you can give a hint in the methods! ! !

Guess you like

Origin blog.csdn.net/weixin_59519449/article/details/123946957