打赏
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 88 下一页
摘要: 1、Vue Test Utils 官网 https://vue-test-utils.vuejs.org/zh/ 2、推荐Jest库 Jest特点有: 一站式测试方案 DOM API 断言库 Mock库 快照 覆盖率 3、实践 (待更新) 阅读全文
posted @ 2020-04-02 10:22 孟繁贵 阅读(1440) 评论(0) 推荐(0)
摘要: 1、官网 https://lerna.js.org/ 2、特点 一键安装依赖 自动更新依赖 独立版本管理 非Npm包 3、实践 (1)采用Independent模式 (2)根据Git提交信息,自动生成changelog (3)eslint规则检查 (4)prettier自动格式化代码 (5)提交代码 阅读全文
posted @ 2020-04-02 10:15 孟繁贵 阅读(1296) 评论(0) 推荐(0)
摘要: 转自:https://juejin.im/post/5e5b488af265da574112089f#heading-14 关注点: @babel/preset-env,是根据浏览器的不同版本中缺失的功能确定代码转换规则的,而不是从 ES 标准的维度来确定转码规则的。现在vuecli都是使用的预设p 阅读全文
posted @ 2020-03-30 22:46 孟繁贵 阅读(100) 评论(0) 推荐(0)
摘要: vue.config.js文件配置: const path = require('path'); function resolve (dir) { return path.join(__dirname, dir) } module.exports = { chainWebpack: config = 阅读全文
posted @ 2020-03-26 14:43 孟繁贵 阅读(424) 评论(0) 推荐(0)
摘要: 设置和获取自定义属性使用$options。 实例代码: new Vue({ customOption: 'foo', created: function () { console.log(this.$options.customOption) // => 'foo' } }) 阅读全文
posted @ 2020-03-23 22:34 孟繁贵 阅读(2474) 评论(0) 推荐(0)
摘要: 1、组件id vue组件id是唯一的,并且是递增的。 下面是vue框架源码: let uid = 0 export function initMixin (Vue: Class<Component>) { Vue.prototype._init = function (options?: Objec 阅读全文
posted @ 2020-03-23 22:32 孟繁贵 阅读(9730) 评论(0) 推荐(0)
摘要: Proxy 的优势如下: Proxy 可以直接监听对象而非属性; Proxy 可以直接监听数组的变化; Proxy 有多达 13 种拦截方法,不限于 apply、ownKeys、deleteProperty、has 等等是 Object.defineProperty 不具备的; Proxy 返回的是 阅读全文
posted @ 2020-03-22 18:13 孟繁贵 阅读(4435) 评论(0) 推荐(1)
摘要: 一、生命周期 生命周期是指vue实例从创建到销毁所经历的一系列过程。vue官网生命周期如下图所示: 上图一共描述了8个生命周期钩子函数,即: 'beforeCreate', 'created', 'beforeMount', 'mounted', 'beforeUpdate', 'updated', 阅读全文
posted @ 2020-03-22 16:46 孟繁贵 阅读(12445) 评论(0) 推荐(1)
摘要: Vue 的父组件和子组件生命周期钩子函数执行顺序可以归类为以下 4 部分: 加载渲染过程 父 beforeCreate -> 父 created -> 父 beforeMount -> 子 beforeCreate -> 子 created -> 子 beforeMount -> 子 mounted 阅读全文
posted @ 2020-03-22 15:59 孟繁贵 阅读(5415) 评论(0) 推荐(0)
摘要: 1、null或者undefined赋值 (1)将变量定义为联合类型 let num: number | undefined | null = 123 (2)将tsconfig的strictNullChecks设置为false。 2、接口定义 interface List { // 只读属性 read 阅读全文
posted @ 2020-03-10 11:45 孟繁贵 阅读(184) 评论(0) 推荐(0)
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 88 下一页
TOP