自定义组件中做页面跳转为什么会跳转两次,onLoad执行两次?
发布于 3 年前 作者 wyao 11875 次浏览 来自 官方Issues

自定义组件中做页面跳转为什么会跳转两次,onLoad执行两次?

Component({

  /**

   * 组件的属性列表

   */

  properties: {

  },

  /**

   * 组件的初始数据

   */

  data: {

  },

  /**

   * 组件的方法列表

   */

  methods: {

。。。。。。

  pageLifetimes: {

    show: function() {

      let that=this;

      // 页面被展示

      console.log(“components selProductType is onShow …”)

      //that.triggerEvent(‘exePageMethod’, { content: ‘我是谁’});

    },

  }

})

1 回复

只能是因为你的代码里跳了两次。

回到顶部