最近掉入小程序的各种坑坑坑…

效果图:
小程序

wxml

view class='wifi'    viewtextWiFi:{{WIFI_name}}/text/view    view密码:        input name="code" type='password' value='{{WIFI_pwd}}' disabled='disabled' bindinput='pwdInput'/input    /view/view

js

var app = getApp()Page({  data: {    code:''  },  onLoad: function (options) {      var that = this      app.util.request({        'url': '*****',//接口地址        'cachetime': '0',        success: function (res) {          console.log(res)          that.setData({            WIFI_name: res.data.WIFI_name,            WIFI_pwd: res.data.WIFI_pwd          })        },      })  },  //获取密码复制  copy:function(){    var that = this    wx.setClipboardData({      data: that.data.WIFI_pwd,      success: function (res) {        wx.showToast({          title: '复制成功!',          icon: 'success',          duration: 2000        })      }    })  },})

…省略了样式,直接上代码…希望会有帮助~

TAG标签: 微信小程序input只读

http://www.xiaochengxub.com/read-105089.html