摘要: 1 module.exports = { 2 root: true, 3 parser: 'babel-eslint', 4 parserOptions: { 5 sourceType: 'module', 6 allowImportExportEverywhere: true //ignore e 阅读全文
posted @ 2020-03-23 10:23 dropInInt 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 1 { 2 // vscode默认启用了根据文件类型自动设置tabsize的选项 3 "editor.detectIndentation": false, 4 // 重新设定tabsize 5 "editor.tabSize": 2, 6 // #每次保存的时候自动格式化 7 "editor.for 阅读全文
posted @ 2020-03-23 10:22 dropInInt 阅读(2260) 评论(0) 推荐(1) 编辑
摘要: 原因:在路由中添加了相同的路由。解决:重写路由的push方法 在src/router/index.js 里面import Router from 'vue-router'下面写入下面方法即可 /** * 重写路由的push方法 */ const routerPush = Router.prototy 阅读全文
posted @ 2020-03-23 10:19 dropInInt 阅读(237) 评论(0) 推荐(0) 编辑
摘要: VSCode(Visual Studio Code)是由微软研发的一款免费、开源的跨平台文本(代码)编辑器,算是目前前端开发几乎完美的软件开发工具。1.VSCode下载VSCode下载链接: https://code.visualstudio.com/ 2.VSCode汉化 3.VSCode常用插件 阅读全文
posted @ 2019-12-24 10:46 dropInInt 阅读(628) 评论(0) 推荐(1) 编辑
摘要: 高阶组件的使用 接上文———— 一、像函数一样直接调用 1 import React, { Component } from 'react' 2 import A from './A' 3 4 class C extends Component { 5 render() { 6 return ( 7 阅读全文
posted @ 2019-12-12 11:08 dropInInt 阅读(121) 评论(0) 推荐(0) 编辑
摘要: internal/modules/cjs/loader.js:638 throw err; ^ Error: Cannot find module 'resolve' 根据提示可以知道有依赖没有安装完成,解决办法是执行 npm install j 阅读全文
posted @ 2019-12-11 18:39 dropInInt 阅读(11196) 评论(1) 推荐(0) 编辑
摘要: 当两个或多个组件有相同的地方,可以将相同的部分抽离出来 先创建三个组件A、B、C A.js 1 import React, { Component } from 'react' 2 3 class A extends Component { 4 render () { 5 return ( 6 <d 阅读全文
posted @ 2019-12-09 17:40 dropInInt 阅读(210) 评论(0) 推荐(0) 编辑
摘要: context是什么 Props属性是由上到下单向传递的 context提供了在组件中共享此类值的方法 context使用 设计目的是共享哪些对于组件来说全局的数据 不要因为仅仅为了避免在几个层级下的组件传递props而使用context context用法 1.先创建一个theme-context 阅读全文
posted @ 2019-12-06 17:50 dropInInt 阅读(267) 评论(0) 推荐(0) 编辑
摘要: js鼠标划过事件一般有两对 onmouseover/onmouseout onmouseenter/onmouseleave 区别: 1.onmouseover/onmouseout 鼠标经过自身会触发该事件,经过子元素也会触发该事件 2.onmouseenter/onmouseleave 鼠标经过 阅读全文
posted @ 2019-12-03 16:28 dropInInt 阅读(6050) 评论(0) 推荐(1) 编辑
摘要: 先下载路由 1 npm install react-router-dom --save-dev 然后新建两个页面 component1.js 1 import React from 'react'; 2 3 class Component1 extends React.Component{ 4 re 阅读全文
posted @ 2019-11-13 15:23 dropInInt 阅读(128) 评论(0) 推荐(0) 编辑