11 2020 档案

摘要:官网学习: https://www.tslang.cn/play/index.html 1. 安装: // 全局安装:npm i -g typescript// 查看版本:tsc --version 2. 使用: tsc test.ts 3. 省点心 tsc --init // 生成 tsconfi 阅读全文
posted @ 2020-11-30 17:03 James2019 阅读(83) 评论(0) 推荐(0) 编辑
摘要:变量 添加默认值 var myname :string = "ccc" 方法 添加默认值 function test(a:string,b:string="bbb",c?:string){} // 带问号,可传可不传, 如有默认值时,不能带问号 test("aaa","bbb","ccc"); // 阅读全文
posted @ 2020-11-27 15:26 James2019 阅读(46) 评论(0) 推荐(0) 编辑
摘要:我的 uniapp 代码是用cli 生成的,电脑没有安装HBuilderX 调用接口 出现 Provisional headers are shown 或者 Status Code: 403 Forbidden,都是跨域问题 manifest.json 加配置 "h5": { "devServer" 阅读全文
posted @ 2020-11-27 11:14 James2019 阅读(4870) 评论(0) 推荐(0) 编辑
摘要:1. 如何找到点击事件调用的方法在哪? 选择元素 选中按钮 =》 点开 【Sources】选项 找到右侧最下的 【Event Listener Breakpoints】=》 勾选 【Mouse】下的 click 此时刷新 浏览器 再点击一下刚才的按钮,此时浏览器会自动定位到方法 断点 . 阅读全文
posted @ 2020-11-25 23:25 James2019 阅读(115) 评论(0) 推荐(0) 编辑
摘要:Set 对象作用 数组去重,注意4 ‘4’ 不同 let arr = [1, 2, 3, 4, 4, '4', '4']; let mySet = new Set(arr); [...mySet]; // [1, 2, 3, 4, '4'] 并集 let a = new Set([1, 2, 3]) 阅读全文
posted @ 2020-11-24 19:57 James2019 阅读(78) 评论(0) 推荐(0) 编辑
摘要:src/bus.js import Vue from 'vue' export default new Vue() src/main.js import Bus from '@/lib/bus' // 引入Bus组件 Vue.prototype.$bus = Bus components01.vue 阅读全文
posted @ 2020-11-20 10:36 James2019 阅读(1316) 评论(0) 推荐(0) 编辑
摘要:除了防抖 节流外 点这里 vue中用指令的形式 export default { install (Vue) { // 防止重复点击 Vue.directive('preventReClick', { inserted (el, binding) { console.log("binding-7", 阅读全文
posted @ 2020-11-18 15:50 James2019 阅读(5978) 评论(0) 推荐(0) 编辑
摘要:第一种: <template> <keep-alive> <router-view v-if="$route.meta.keepAlive"></router-view> </keep-alive> <router-view v-if="!$route.meta.keepAlive"></route 阅读全文
posted @ 2020-11-13 11:56 James2019 阅读(2871) 评论(0) 推荐(0) 编辑
摘要:原始用法: 1.回调函数 2.事件监听 3.发布/订阅 4.Promise 对象 常用promise如下: function get1(){ return new Promise((resolve,reject)=>{ setTimeout(()=>{resolve(1)},2000) }) } a 阅读全文
posted @ 2020-11-12 18:52 James2019 阅读(108) 评论(0) 推荐(0) 编辑
摘要:// vue 中的简单使用 clearTimeout(this.timeout) this.timeout = setTimeout(() => { this.searchData(keywords) // 开始搜索 }, 300) 详见:https://www.jianshu.com/p/f9f6 阅读全文
posted @ 2020-11-11 11:20 James2019 阅读(708) 评论(0) 推荐(0) 编辑
摘要:1、 通过jsonp跨域2、 document.domain + iframe跨域3、 location.hash + iframe4、 window.name + iframe跨域5、 postMessage跨域6、 跨域资源共享(CORS)7、 nginx代理跨域8、 nodejs中间件代理跨域 阅读全文
posted @ 2020-11-11 11:17 James2019 阅读(122) 评论(0) 推荐(0) 编辑

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