摘要: MutationObserver构造函数只要监听到了指定内容发生了变化,就会执行传入的回调函数 mutationList: 发生变化的数组 observer: 观察者对象 const observer = new MutationObserver((mutationList, observer) = 阅读全文
posted @ 2022-07-23 04:11 吃惊夜夜 阅读(96) 评论(0) 推荐(0) 编辑
摘要: template> <swiper ref="mySwiper" :options="swiperOptions" class="banner" v-if="banners.length>0"> <swiper-slide v-for="value in banners" :key="value.b 阅读全文
posted @ 2022-07-23 01:54 吃惊夜夜 阅读(1223) 评论(0) 推荐(0) 编辑
摘要: Error: Can‘t resolve ‘swiper/dist/css/swiper.css‘ Error: Can't resolve 'vue-awesome-swiper' 试了众多方法后发现 还是安装旧版本的swiper,其他版本根本就没有dist的目录 npm install vue- 阅读全文
posted @ 2022-07-23 00:47 吃惊夜夜 阅读(265) 评论(0) 推荐(0) 编辑
摘要: 1.什么是指令? 指令就是Vue内部提供的一些自定义属性, 这些属性中封装好了Vue内部实现的一些功能 只要使用这些指令就可以使用Vue中实现的这些功能 2.Vue数据绑定的特点 只要数据发生变化, 界面就会跟着变化 v-once:让界面不要跟着数据变化, 只渲染一次、 v-clock:数据渲染之后 阅读全文
posted @ 2022-07-16 18:46 吃惊夜夜 阅读(46) 评论(0) 推荐(0) 编辑
摘要: // map 方法,对数组进行循环操作 并传入一个新的数组 const movements = [200, 450, -400, 3000, -650, -130, 70, 1300]; const eurToUsd = 1.1; // const movementsUSD = movements. 阅读全文
posted @ 2022-07-12 13:55 吃惊夜夜 阅读(73) 评论(0) 推荐(0) 编辑
摘要: const secureBooking = function () { // 调用这个函数 这个值外部无法访问 let passengerCount = 0; return function () { passengerCount++; console.log(`${passengerCount} 阅读全文
posted @ 2022-07-11 20:38 吃惊夜夜 阅读(62) 评论(0) 推荐(0) 编辑
摘要: ES6如何选择数据结构, 每种数据结构的优缺点; 基本上有三种数据来源 1、可以写入数据,在程序源代码本身,如状态消息,将根据用户操作显示在网页上 2、数据可以来自用户界面 3、数据来自外部来源,通常是来自一个WebAPI 我们需要储存在某个地方,Javascript有四种内置的数据结构,所以需要在 阅读全文
posted @ 2022-07-07 20:25 吃惊夜夜 阅读(31) 评论(0) 推荐(0) 编辑
摘要: // ES6 map数据类型 const rest = new Map(); // 使用set()方法填充数据 set()方法返回更新后的全部数据; rest.set('name', 'Classico Italiano'); rest.set(1, 'Firenze,Ttaly'); consol 阅读全文
posted @ 2022-07-07 19:29 吃惊夜夜 阅读(148) 评论(0) 推荐(0) 编辑
摘要: // ES6 Set集合数据类型 const ordersSet = new Set([ 'Pasta', 'Pizza', 'Pizza', 'Risotto', 'Pasta', 'Pizza', ]); // 只会显示不重复的数据 console.log(ordersSet); // 集合可拆 阅读全文
posted @ 2022-07-07 17:19 吃惊夜夜 阅读(35) 评论(0) 推荐(0) 编辑
摘要: // 可选链接 ?. console.log(restaurant.openinghours.mon?.open); console.log(restaurant.openinghours?.mon?.open); const days = ['mon', 'tue', 'web', 'thu', 阅读全文
posted @ 2022-07-07 00:57 吃惊夜夜 阅读(127) 评论(0) 推荐(0) 编辑