摘要:
//利用居明组匹配更改时间格式function transformTime(arr) { try { const RE_DATE = /(?<year>\d{4})年(?<month>\d{2})月(?<day>\d{2})日/; var newarr = []; for (var i = 0; i 阅读全文
摘要:
Object.defineProperty 是 Es5 的方法,Proxy 是 Es6 的方法 defineProperty 不能监听到数组下标变化和对象新增属性,Proxy 可以 defineProperty 是劫持对象属性,Proxy 是代理整个对象 defineProperty 局限性大,只能 阅读全文
摘要:
vue3.x的语法虽然和vue2 比没发生什么变化,但是在写法上发生了很大的变化 在vue2中我们可以通过this$refs.['XX'] 获取dom 元素,但是在vue3.x中已经舍弃了refs,下面就是vue3中获取dom 元素 1.为节点添加一个 ref 名称2.创建 ref 响应式常量并且与 阅读全文
摘要:
代码是基于 vue3.X <template> <div> <el-button style="margin:20px 0;" type='primary' @click="fd">防抖事件</el-button> <div style="margin-bottom:40px"> <span>防抖事 阅读全文
摘要:
组件封装的代码: <template> <div class="time_quarter"> <!-- <div class="time_box"></div> --> <slot>日期:</slot> <mark style="position:fixed;top:0;bottom:0;left: 阅读全文
摘要:
主要的有三点变化: 1:vue2和vue3双向数据绑定原理发生了改变 vue2的双向数据绑定是利用ES5的一个APIObject.definePropert() 对数据进行劫持,结合发布订阅模式的方式来实现的。 vue3中使用了ES6的Proxy API对数据代理。 相比vue2.x,使用proxy 阅读全文
摘要:
1、手机号码的校验 const phoneReg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/ const phoneStr1 = '18886233487' console.log(phoneReg.test(phoneStr1)) // true const phoneStr 阅读全文
摘要:
::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar { width: 8px; height: 8px; /* display: none; */ } /* //滚动条的滑块 */ ::-webkit-scroll 阅读全文
摘要:
import Vue from 'vue' import Router from 'vue-router' import Home from '../views/index.vue' Vue.use(Router) export default new Router({ routes: [ { pa 阅读全文
摘要:
// reduce()函数的应用 var people = [{ name: 'Alice', age: 21 }, { name: 'Max', age: 20 }, { name: 'Jane', age: 20 }, { name: 'Jane', age: 47 }, { name: 'li 阅读全文