会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
James的博客园
博客园
首页
新随笔
联系
管理
上一页
1
2
3
4
5
6
7
8
9
10
···
31
下一页
2020年11月30日
ts 笔记
摘要: 官网学习: 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
阅读(89)
评论(0)
推荐(0)
2020年11月27日
ts 笔记
摘要: 变量 添加默认值 var myname :string = "ccc" 方法 添加默认值 function test(a:string,b:string="bbb",c?:string){} // 带问号,可传可不传, 如有默认值时,不能带问号 test("aaa","bbb","ccc"); //
阅读全文
posted @ 2020-11-27 15:26 James2019
阅读(48)
评论(0)
推荐(0)
uniapp H5页面使用uni.request时,出现跨域问题
摘要: 我的 uniapp 代码是用cli 生成的,电脑没有安装HBuilderX 调用接口 出现 Provisional headers are shown 或者 Status Code: 403 Forbidden,都是跨域问题 manifest.json 加配置 "h5": { "devServer"
阅读全文
posted @ 2020-11-27 11:14 James2019
阅读(4958)
评论(0)
推荐(0)
2020年11月25日
浏览器调试技巧
摘要: 1. 如何找到点击事件调用的方法在哪? 选择元素 选中按钮 =》 点开 【Sources】选项 找到右侧最下的 【Event Listener Breakpoints】=》 勾选 【Mouse】下的 click 此时刷新 浏览器 再点击一下刚才的按钮,此时浏览器会自动定位到方法 断点 .
阅读全文
posted @ 2020-11-25 23:25 James2019
阅读(122)
评论(0)
推荐(0)
2020年11月24日
ES6 Set 常用
摘要: 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
阅读(81)
评论(0)
推荐(0)
2020年11月20日
vue 自带的 bus 事件使用
摘要: 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
阅读(1321)
评论(0)
推荐(0)
2020年11月18日
vue中防止用户在短时间内频繁多次点击按钮
摘要: 除了防抖 节流外 点这里 vue中用指令的形式 export default { install (Vue) { // 防止重复点击 Vue.directive('preventReClick', { inserted (el, binding) { console.log("binding-7",
阅读全文
posted @ 2020-11-18 15:50 James2019
阅读(5986)
评论(0)
推荐(0)
2020年11月13日
vue 几种配置缓存与不缓存
摘要: 第一种: <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
阅读(2876)
评论(0)
推荐(0)
2020年11月12日
js 异步处理
摘要: 原始用法: 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
阅读(118)
评论(0)
推荐(0)
2020年11月11日
浅析函数防抖与函数节流
摘要: // vue 中的简单使用 clearTimeout(this.timeout) this.timeout = setTimeout(() => { this.searchData(keywords) // 开始搜索 }, 300) 详见:https://www.jianshu.com/p/f9f6
阅读全文
posted @ 2020-11-11 11:20 James2019
阅读(713)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
9
10
···
31
下一页
公告