随笔分类 -  TypeScript

摘要:Cocos Creator 3.8.x bundle注意知识点,需掌握bundle核心知识点才能理解。 bundle核心知识点 : https://www.cnblogs.com/wujinhong/p/18341405 注意知识点(引擎3.8.3实际运行测试过): 1、默认4个Bundle bui 阅读全文
posted @ 2024-08-04 05:46 风别鹤 阅读(298) 评论(0) 推荐(0) 编辑
摘要:错误码: Access to script at 'chunks:///_virtual/xxx.ts' from origin 'https://xxx.com' has been blocked by CORS policy: Cross origin requests are only sup 阅读全文
posted @ 2024-07-25 21:30 风别鹤 阅读(115) 评论(0) 推荐(0) 编辑
摘要:braces: 大括号 brackets: 中括号 parenthesis: 圆括号(小括号、括号) semicolon: 分号 comma: 逗号 阅读全文
posted @ 2024-04-09 02:24 风别鹤 阅读(16) 评论(0) 推荐(0) 编辑
摘要:1.导入类时,批量导入 2.导入 override...关键字时,批量导入 3、.x .y-->.setPosition( block.position.x, block.position.y ); 4、this.node.scale = 0.6;-->this.node.setScale(0.6, 阅读全文
posted @ 2024-02-29 17:21 风别鹤 阅读(251) 评论(0) 推荐(0) 编辑
摘要:Object.keys 对象的键转化为数组 Object.values 对象的属性值转化为数组 Object.assign 对象的合并 Array.from() 伪数组对象的属性值转化为数组。类似Object.values Array.reduce(function(prev, currentVal 阅读全文
posted @ 2023-10-01 16:47 风别鹤 阅读(12) 评论(0) 推荐(0) 编辑
摘要:1、每个 ES Module 都是运行在单独的私有作用,ESM 自动采用严格模式,忽略use strict <script type="module">console.log(this);// this undefined 私有域,不能访问全局变量 </script> <script type="m 阅读全文
posted @ 2023-09-16 23:24 风别鹤 阅读(51) 评论(0) 推荐(0) 编辑
摘要:canvas.style = `touch-action: none; width:widthpx;height:{ height }px; cursor: inherit;`; 阅读全文
posted @ 2023-07-28 16:23 风别鹤 阅读(31) 评论(0) 推荐(0) 编辑
摘要:1、项目*.ts自动编译 tsc.watch2web npm install --save-dev webpack-dev-server npm install --save-dev 和 npm install -D 作用一样 阅读全文
posted @ 2023-06-02 17:45 风别鹤 阅读(53) 评论(0) 推荐(0) 编辑
摘要:1、{{}} data2、""等同{{}},数据单向绑定v-bind: 简化 :3、v-if v-else4、v-for="(i, index) in array"5、v-on: 等同 @ ,method6、[] 三元运算7、已算属性,computed 8、组件,props,template 9、数 阅读全文
posted @ 2022-06-08 03:50 风别鹤 阅读(44) 评论(0) 推荐(0) 编辑
摘要:浮点数运算bug:相减、相乘时,出现一长串小数 149.7 * 100 = 14969.999999999998 3.57 - 2.33 = 1.2399999999999998 这是JavaScript浮点运算采用IEEE 754标准导致的Bug。 解决方法:采用整数来运算,再转化为浮点数。 采用 阅读全文
posted @ 2020-04-09 16:35 风别鹤 阅读(304) 评论(0) 推荐(0) 编辑
摘要:1、初使项目 npm init my_project 2、发布 cd my_project npm publish 3、撤销发布的包 终端执行 npm unpublish 例如: # 1、删除某个版本 npm unpublish my_project@1.0.0 #2、 删除整个npm市场的包 np 阅读全文
posted @ 2019-10-15 14:27 风别鹤 阅读(194) 评论(0) 推荐(0) 编辑
摘要:const heapdump = require('heapdump'); setTimeout( ()=>{ heapdump.writeSnapshot(`${process.cwd()}/` + Date.now() + '.heapsnapshot'); }, 12000 ); 阅读全文
posted @ 2019-08-16 10:43 风别鹤 阅读(262) 评论(0) 推荐(0) 编辑
摘要:1、安装Node.js扩展,支持TypeScript语法 npm install -g typescriptnpm install -g typings 2、创建项目目录project_folder,进入目录。创建Node.js项目,执行以下命令: npm init 3、在项目的目录下,创建Type 阅读全文
posted @ 2017-08-09 23:16 风别鹤 阅读(3783) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示