微信小程序 获取input 只读value值

来源:互联网 发布:伊塞亚托马斯数据 编辑:程序博客网 时间:2024/05/16 12:50

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

效果图:
这里写图片描述

wxml

<view class='wifi'>    <view><text>WiFi:{{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        })      }    })  },})

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