上一页 1 ··· 40 41 42 43 44 45 46 47 48 ··· 63 下一页
摘要: require any require(string path) 引入模块。返回模块通过module.exports或exports暴露的接口。 参数 名称 类型 说明 path string 需要引入模块文件相对于当前文件的相对路径,或npm模块名,或npm模块路径。不支持绝对路径 示例代码: / 阅读全文
posted @ 2019-12-21 10:15 吴小明- 阅读(530) 评论(0) 推荐(0) 编辑
摘要: import import可以在该文件中使用目标文件定义的template,如: 在mine.wxml中定义了一个叫item的template: <template name="item"> <text>{{text}}</text> </template> 在detail.wxml中引用了mine 阅读全文
posted @ 2019-12-21 10:08 吴小明- 阅读(3290) 评论(0) 推荐(0) 编辑
摘要: 模板的定义:<template name="msgItem"> 模板的使用:<template is="msgItem"></template> 模板的调用:<import src="../template/list/list.wxml" /> 如果是同一个文件下定义和使用模板不需要引入 模板的样式 阅读全文
posted @ 2019-12-21 10:03 吴小明- 阅读(271) 评论(0) 推荐(0) 编辑
摘要: // 第一种:地址栏 ? 后面传值,在detail.js中onLoad生命周期中接收参数 toDetail(e){ var id=10, title="我是详情页"; wx.navigateTo({ url: '/pages/detail/detail?id=' + id + '&title=' + 阅读全文
posted @ 2019-12-21 09:54 吴小明- 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 点击复制文本功能:wx.setClipboardData() 基础库 1.1.0 开始支持,低版本需做兼容处理 // 当期基础库版本2.8.3 // 复制功能 copy(){ wx.setClipboardData({ data: '这是我要复制的内容1111111111111', success( 阅读全文
posted @ 2019-12-21 09:51 吴小明- 阅读(352) 评论(0) 推荐(0) 编辑
摘要: Page({ onLoad:function(){ // 在onLoad中调用发送请求的函数 this.getProList(); } getProList:function(){ var self=this; // 在这里向服务端发送请求 wx.request({ url:"", method:" 阅读全文
posted @ 2019-12-21 09:50 吴小明- 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 界面 交互 wx.showLoading() 显示loading提示框。需主动调用wx.hideLoading()才能关闭提示框 参数: 属性 类型 默认值 必填 说明 title string 是 提示的内容 mask boolean false 否 是否显示透明蒙层,防止触摸穿透 success 阅读全文
posted @ 2019-12-21 09:48 吴小明- 阅读(999) 评论(0) 推荐(0) 编辑
摘要: wx.switchTab() 跳转到tabBar页面,并关闭其他所有非tabBar页面 wx.reLaunch() 关闭所有页面,打开到应用内某个页面 wx.redirectTo() 关闭当前页面,跳转到应用内的某个页面。但是不能跳转到tabBar页面 以上几种方法相当于replace(),没有返回 阅读全文
posted @ 2019-12-21 09:44 吴小明- 阅读(209) 评论(0) 推荐(0) 编辑
摘要: <button bindtap="phonecall">拨打电话</button> // js Page({ phonecall:function(){ wx.makePhoneCall({ phoneNumber: '1340000' //仅为示例,并非真实的电话号码 }) } }) 注意:在宠物 阅读全文
posted @ 2019-12-21 09:42 吴小明- 阅读(369) 评论(0) 推荐(0) 编辑
摘要: <!-- 结构 --> <view class="wrapper"> <block wx:for="{{desc}}"> <view bindtap="toggle" data-index="{{index}}" class="{{descIndex index?'active':''}}">{{i 阅读全文
posted @ 2019-12-20 22:16 吴小明- 阅读(563) 评论(0) 推荐(0) 编辑
上一页 1 ··· 40 41 42 43 44 45 46 47 48 ··· 63 下一页