- 博客(21)
- 收藏
- 关注
原创 Electron - 跨平台桌面应用开发工具的使用总结
width: 80,frame: false, // 透明窗口transparent: true, // 透明窗口backgroundColor: '#00000000', // 透明窗口autoHideMenuBar: true, // 透明窗口})
2024-05-16 14:13:43
1343
原创 npm发布js工具包
2、将token复制到github对应仓库的秘钥中。1、在npm中生成 Access Tokens。配置的scripts中增加测试脚本。,用于之后CI中通过。
2024-01-03 11:24:16
1660
原创 Nuxt3重构问题总结
警告,这可能是初始化时存在某个判断条件,该条件在服务端渲染和客户端时存在不一样的表现,进而导致服务端水合结果与客户端不一致。如:localStorage的判断、onMounted内的数值初始化等。默认情况下,useFetch会在异步函数解析完成之前使用Vue的Suspense进行页面导航,而Suspense的#fallback默认为空,从而造成白屏现象。升级完成后,mysql也将会被升级至mysql 8,需要重新设置root用户密码和权限。调整location匹配规则,过滤_nuxt路径下的静态资源。
2024-01-02 09:24:01
1753
原创 prerender-spa-plugin使用总结
prerender-spa-plugin 利用了 Puppeteer 的爬取页面的功能。Puppeteer 是一个 Chrome官方出品的 headlessChromenode 库。它提供了一系列的 API, 可以在无 UI 的情况下调用 Chrome 的功能, 适用于爬虫、自动化处理等各种场景。它很强大,所以很简单就能将运行时的 HTML 打包到文件中。
2023-12-29 16:48:55
2620
原创 ios滚动穿透问题的两个解决方案
1、当触摸元素有-webkit-overflow-scrolling样式时,若触摸元素有滚动条,则不会发生滚动穿透,若触摸元素无滚动条,则touchmove事件依然会穿透至视图下层带有-webkit-overflow-scrolling的元素上。一般弹框是这种情况,这也是需要主要处理情况,而且这并不是由事件穿透造成的bug,所以阻止事件传播并没有用。2、当触摸元素无-webkit-overfl...
2020-04-11 16:49:17
3042
1
原创 Vue父子组件数据双向绑定v-model
// 父组件<template> <div id="app"> <children v-model="flag"></children> </div></template><script>import children from './test/children.vue';export...
2020-01-06 16:40:06
1195
原创 ios输入框聚焦问题
众所周知,ios下的网页有个特性——不允许JS自动获取input输入框的焦点并调出虚拟键盘,归根结底是聚焦事件的触发源头必须是用户,所以我们不管怎么模拟click再focus都是无效的。这儿记录一下为什么用户点击了页面的按钮,input.focus()仍然无效,demo如下<template> <div id="app"> <input type...
2020-01-06 16:13:08
2374
1
原创 css div浮动后,兄弟节点的文档元素会环绕浮动的div
<div> <div style="float: left;width: 50px;height: 50px;background: red;"></div> <div style="width: 100px;height: 100px;background: yellow;"> <p>text</p&g...
2019-04-24 17:04:47
617
原创 js中的短路运算
let res = {}// 有且仅有每一项都存在时才有值,且值取最后一项console.log(res && res.data && res.data.msg)// 第一项有时取第一项,第一项无、第二项有时取第二项...console.log(res.data || res.msg || res.message)// exampleconsole...
2019-04-19 15:18:38
391
1
原创 promise微任务的执行
var promise = new Promise(function(resolve, reject) { console.log('start'); resolve();});promise.then(function() { console.log('end');});for(var i=0;i<100;i++) { console.log(i...
2018-10-16 15:46:27
248
1
原创 微信小程序·云开发数据库初始化报错
wx.cloud.init() //提示init nout found 注意点:1、无游客模式、也不可以使用 测试号2、项目设置-基础库选择2.2.3以上3、app.json配置文件添加字段 "cloud": true tips:cloud init error、operateWXData:fail system error //这个两个错误一般是微信服务器...
2018-09-25 15:19:02
6526
原创 数组深度克隆
1、[].concat(arr)2、let arr = []let arr2 = JSON.parse(JSON.stringify(arr))3、let arr = [1, 2]let arr2 = [...arr]
2018-09-19 16:19:12
1769
原创 Vue父子组件数据双向绑定,子组件可修改props
父组件 => props[parent-data] => 子组件 => watch[parent-data] => children-data =parent-data // 子组件监听父组件的改变子组件 => $emit[children-data] => 父组件 => parant-data = children-data // 子组件通知父组件...
2018-08-17 16:02:23
6202
原创 js局部变量
1、保持局部变量不被回收function fn() { var n = 999; nAdd = function() { n+=1 } return function() { return n }}var result = fn();console.log(result()) // 999nAdd();console.log(result()) // 1...
2018-08-03 14:26:08
176
1
原创 js == 和 ===
// true var o = {} console.log('1' == true) console.log(1 == true) console.log(0 == false) console.log('' == false) console.log(null == o.property) // false cons...
2018-08-03 11:04:46
1155
1
原创 window、document添加事件addEventListener
事件捕获,从dom结构上到下,window.addEventListener先于document.addEventListener被捕获事件冒泡,从dom结构底层向上传递,document.addEventListener先于window.addEventListener被触发在addEventListener第三个参数处可指定事件是否在捕获或冒泡阶段执行。element.addEv...
2018-08-01 18:12:06
11564
原创 created、mounted使用上的区别
mounted是组件的最后一步,含义是已经载入到页面了,生命周期在编译完成的HTML挂载至页面后,created指的是Vue实例创建,两个差别是el是否被$el替换,mounted中编译完成的HTML已经指向el属性所指的虚拟dom,一般是把ajax请求,数据初始化操作都放在mounted里面。...
2018-07-30 17:54:07
2284
原创 Vue数组更新检测无效
Object.observe(),它可以异步观察Javascript中对象变化的方法,而无需你去使用一个其他的JS库。它允许一个观察者接收一个按照时间排序的变化记录序列,这个序列描述的是一列被观察的对象所发生的变化。 vue中Observer的构造函数constructor (value: any) { this.value = value thi...
2018-07-30 16:17:02
1938
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人