摘要: <input type="file" class="file"> .file { width: 80px; height: 30px; font-size: 0; padding: 0; cursor: pointer; } 阅读全文
posted @ 2020-02-17 17:34 shirliey 阅读(785) 评论(0) 推荐(0) 编辑
摘要: 类和接口的区别:接口中只声明成员方法,不做实现;类声明并实现方法。 //属性接口 interface Config { color ?: string; width: number; [propName: string]: any; } function test(value: Config){ c 阅读全文
posted @ 2020-02-13 11:53 shirliey 阅读(2441) 评论(0) 推荐(0) 编辑
摘要: 1、布尔值 let a: boolean = true; 2、数字 let a: number = 5; 3、字符串 let a: string = 'Hello'; 4、数组 //方法1 let a: [number] = [1, 2, 3]; //方法2 let a: Array<number> 阅读全文
posted @ 2020-01-16 15:21 shirliey 阅读(297) 评论(0) 推荐(0) 编辑
摘要: 1、bindinput 其中 e.detail 是获取 input 数据 其中包含value值, cursor 是获取光标的位置。 在js 中获取数据,通过data.detail.value获取数据,获得的是json对象数据键值对一一对应 阅读全文
posted @ 2020-01-07 11:08 shirliey 阅读(30570) 评论(0) 推荐(3) 编辑
摘要: index.wxml index.js 阅读全文
posted @ 2019-12-31 14:00 shirliey 阅读(658) 评论(0) 推荐(0) 编辑
摘要: id :map 组件的 id,在 wx.createMapContext(mapId, this) 中需要用到 longitude :map 组件的中心经度 latitude:map 组件的中心纬度 scale:缩放级别,取值范围为5-18,默认为16 show-location:显示带有方向的当前 阅读全文
posted @ 2019-12-26 17:03 shirliey 阅读(2432) 评论(0) 推荐(0) 编辑
摘要: 在 app.json 里面增加 permission 属性配置(小游戏需在game.json中配置): index.wxml: index.js: 阅读全文
posted @ 2019-12-11 09:46 shirliey 阅读(944) 评论(0) 推荐(0) 编辑
摘要: 1、for(var i=0; i<10; i++):遍历数组 2、for...in:遍历对象+遍历数组 3、for...of:遍历数组 阅读全文
posted @ 2019-12-10 10:40 shirliey 阅读(562) 评论(0) 推荐(0) 编辑
摘要: 浅拷贝2-只复制一层对象的属性,如果对象中的属性值是对象,浅拷贝并不会复制对象属性中的属性 阅读全文
posted @ 2019-11-28 17:20 shirliey 阅读(2398) 评论(0) 推荐(0) 编辑
摘要: 1、遍历元素 2、字符串匹配 所有字符串匹配技术都非常快,但应谨慎使用,以免造成浪费。通常,在Opera中使用非常简单的字符串匹配,stringObject.indexOf比stringObject.match更快。如果搜索简单的字符串匹配项,应尽可能使用indexOf而不是正则表达式匹配项。 除非 阅读全文
posted @ 2019-10-30 14:23 shirliey 阅读(964) 评论(0) 推荐(0) 编辑