会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
ltog
博客园
首页
新随笔
联系
订阅
管理
2021年6月11日
Object使用
摘要: Object.keys(..) 会返回一个数组,包含所有可枚举属性, Object.getOwnPropertyNames(..),会返回一个数组,包含所有属性,无论它们是否可枚举。 in 操作符会检查属性是否在对象及其 [[Prototype]] 原型链中,hasOwnProperty(..) 只
阅读全文
posted @ 2021-06-11 14:09 ltog
阅读(44)
评论(0)
推荐(0)
2021年6月2日
单页面应用和多页面应用的区别及优缺点
摘要: 单页面: 概念:就是只有一张Web页面的应用。单页应用程序 (SPA) 是加载单个HTML 页面并在用户与应用程序交互时动态更新该页面的Web应用程序。浏览器一开始会加载必需的HTML、CSS和JavaScript,所有的操作都在这张页面上完成,都由JavaScript来控制。单页面的跳转仅刷新局部
阅读全文
posted @ 2021-06-02 14:56 ltog
阅读(3801)
评论(0)
推荐(0)
2021年4月22日
正则常用匹配
摘要: // 转驼峰 function toCamelCase(str,pattern) { // replace第二个参数为一个函数时,在此场景中, // 第一个参数为正则匹配出来的内容, 依次是 -c -r -c, // 第二个参数是分组中的内容, 也就是 c r c return str.replac
阅读全文
posted @ 2021-04-22 14:18 ltog
阅读(119)
评论(0)
推荐(0)
2021年4月20日
npm --save-dev 和 --save 的区别
摘要: --save-dev || -D // 开发依赖(辅助)--save || -S // 运行依赖(发布) –save : dependencies 键下,发布后还需要依赖的模块,譬如像Vue或者Angular框架类似的,我们在开发完后后肯定还要依赖它们,否则就运行不了。 –save-dev : de
阅读全文
posted @ 2021-04-20 19:38 ltog
阅读(73)
评论(0)
推荐(0)
2021年3月17日
js常用小技巧
摘要: 数组扁平化 const arr = [1, 2, 3, [4, [5, 6, [7,8]]]]; console.log(arr.flat(Infinity)); // [1, 2, 3, 4, 5, 6, 7, 8] console.log(arr.join().split(',')); // [
阅读全文
posted @ 2021-03-17 11:36 ltog
阅读(61)
评论(0)
推荐(0)
2021年3月12日
js复制文字到剪切板
摘要: document.getElementById('copy').onclick = function () { let input = document.createElement('input'); input.setAttribute('id','input'); input.value = '
阅读全文
posted @ 2021-03-12 18:36 ltog
阅读(58)
评论(0)
推荐(0)
2021年3月11日
js优化小技巧
摘要: 1、含有多个条件的if语句 我们可以在数组中存储多个值,并且可以使用数组的 includes 方法。 //longhand if (x 'abc' || x 'def' || x 'ghi' || x 'jkl') { //logic } //shorthand if (['abc', 'def',
阅读全文
posted @ 2021-03-11 10:22 ltog
阅读(79)
评论(0)
推荐(0)
2021年3月3日
Vue之组件更新
摘要: 示例1:新旧节点不同 <template> <div id="app"> <hello-world :flag="flag" /> <button @click="toggle">toggle</button> </div> </template> <script> import HelloWorl
阅读全文
posted @ 2021-03-03 14:51 ltog
阅读(1436)
评论(0)
推荐(0)
2021年2月26日
Vue之计算属性
摘要: 示例: <template> <div id="app"> <div ref="msg">{{ name }}</div> <button @click="change">change</button> <button @click="changeLast">changeLast</button>
阅读全文
posted @ 2021-02-26 11:06 ltog
阅读(87)
评论(0)
推荐(0)
2021年2月24日
Vue之nextTick
摘要: 例子 <template> <div id="app"> <!-- <hello-world />--> <div ref="msg">{{ msg }}</div> <button @click="change">change</button> </div> </template> <script
阅读全文
posted @ 2021-02-24 16:11 ltog
阅读(128)
评论(0)
推荐(0)
下一页
公告