流浪のwolf

卷帝

导航

上一页 1 ··· 55 56 57 58 59 60 61 62 63 ··· 73 下一页

2022年10月16日

v-if 为什么不能和 v-for 一起使用 ?

摘要: 当 Vue 处理指令时,v-for 比 v-if 具有更高的优先级,通过v-if 移动到容器元素,不会再重复遍历列表中的每个值。取而代之的是,我们只检查它一次,且不会在 v-if 为否的时候运算 v-for v-if不能和v-for一起使用的原因是v-for的优先级比v-if高,一起使用会造成性能浪 阅读全文

posted @ 2022-10-16 19:07 流浪のwolf 阅读(548) 评论(0) 推荐(0) 编辑

vue 的常用指令以及作用 ·

摘要: 1、 v-model 多用于表单元素实现双向数据绑定(同 angular 中的 ng-model) 2、 v-for 格式: v-for="字段名 in(of) 数组 json" 循环数组或 json(同 angular 中的ng-repeat),需要注意从 Vue2 开始取消了$index 3、 阅读全文

posted @ 2022-10-16 19:04 流浪のwolf 阅读(46) 评论(0) 推荐(0) 编辑

forEach filter some map every 的区别

摘要: forEach 遍历数组,不会改变原数组,没有返回值 ; filter 过滤数组 相同点:都不改变原数组,都是数组的实例方法 ; 阅读全文

posted @ 2022-10-16 18:57 流浪のwolf 阅读(13) 评论(0) 推荐(0) 编辑

js的宏任务和微任务有哪些,是怎么执行的 ?

摘要: 事件循环有宏任务和微任务; 宏任务所处的队列就是宏任务队列,队列可以有多个,第一个队列只有一个任务就是执行主线程的js代码,剩余队列任务有setTimeout setInterval ;微任务所处的队列就是微任务队列,只能有一个队列,有process.nextTick() promise.then( 阅读全文

posted @ 2022-10-16 18:53 流浪のwolf 阅读(163) 评论(0) 推荐(0) 编辑

文章的评论 和 评论的恢复组件

摘要: 封装请求接口 : get 提交的query数据放在params里面(或者放在url?后面) /** * 文章评论 * 功能1: 获取文章的评论 * 》 type a 评论类型,a-对文章(article)的评论,c-对评论(comment)的回复 * > source 文章 id 源id,文章id或 阅读全文

posted @ 2022-10-16 18:47 流浪のwolf 阅读(48) 评论(0) 推荐(0) 编辑

markdown.css 设置文章的样式

摘要: 返回的详情文章内容是标签加内容文字,使用 markdown,css 渲染样式 : .markdown-body .octicon { display: inline-block; fill: currentColor; vertical-align: text-bottom; } .markdown 阅读全文

posted @ 2022-10-16 15:39 流浪のwolf 阅读(264) 评论(0) 推荐(0) 编辑

点赞,取消点赞组件

摘要: <template> <div class="collect-container"> <van-loading v-if="isLoading" type="spinner" color="#1989fa"></van-loading> <van-icon v-else :color="attitu 阅读全文

posted @ 2022-10-16 15:33 流浪のwolf 阅读(13) 评论(0) 推荐(0) 编辑

收藏,取消收藏文章组件

摘要: 组件 :collectArticle <template> <div class="collect-container"> <van-loading v-if="isLoading" type="spinner" color="#1989fa"></van-loading> <van-icon v- 阅读全文

posted @ 2022-10-16 15:17 流浪のwolf 阅读(14) 评论(0) 推荐(0) 编辑

数组去重方法

摘要: 1. 使用 es6 set 方法 [...new Set(arr)] let arr = [1,2,3,4,3,2,3,4,6,7,6]; let unique = (arr)=> [...new Set(arr)]; unique(arr);//[1, 2, 3, 4, 6, 7] 2. inde 阅读全文

posted @ 2022-10-16 14:14 流浪のwolf 阅读(14) 评论(0) 推荐(0) 编辑

ES5 和 ES6 的区别,说几个 ES6 的新增方法

摘要: ECMAscript5.,即ES5 ,表示 ECMAscript的第五次修订-2009 ; ECMAscript6.,即ES6 ,表示 ECMAscript的第六次修订-2015 ; ES6 是对于 ES5的一次改进 ,更加简洁,提高了开发效率 ; 1. 新增声明命令 let const 在 ES6 阅读全文

posted @ 2022-10-16 12:09 流浪のwolf 阅读(161) 评论(0) 推荐(0) 编辑

上一页 1 ··· 55 56 57 58 59 60 61 62 63 ··· 73 下一页