javascript - 微信小程序 数据问题

查看:67
本文介绍了javascript - 微信小程序 数据问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

小程序页面的数据

为什么通过 this.text 取不到 text的值呢

解决方案

应该是 this.data.text
下面是我写的小程序的一部分代码,希望对你有所帮助:

Page({
  onShareAppMessage:function(){
    return {
      title:'优恳设计'
    }
  },
  data: {
    caseUrls: [{ src: '1.png', full: '1a.png' }, { src: '2.png', full: '2a.png' }, { src: '3.png', full: '3a.png' }, { src: '4.png', full: '4a.png' }, { src: '5.png', full: '5a.png' }, { src: '6.png', full: '6a.png' }, { src: '7.png', full: '7a.png' }, { src: '8.png', full: '8a.png' }, { src: '9.png', full: '9a.png' }, { src: '10.png', full: '10a.png' }],
    page:2
  },
  lower:function(e){
    this.setData({
      page:this.data.page+2
    })
  },
  caseImg: function (event) {
    console.log(event.target.dataset.full)
    wx.previewImage({
      urls: [event.target.dataset.full]
    })
  }
})

这篇关于javascript - 微信小程序 数据问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆