Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

微信小程序 数据问题

小程序页面的数据
图片描述

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

应该是 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]
    })
  }
})

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...