元素中有图片时,元素外层点击事件无效
摘要:元素中有图片时,元素外层点击事件在某些浏览器(qq浏览器)中无效,会被默认拦截成图片预览,无法执行预期事件。 解决方法: <div @click="go"> <img src="./logo.png" onclick="return false" alt="" /> </div>
阅读全文
axios -- has been blocked by CORS policy: Request header field content-type is not allowed by Access-Control-Allow-Headers in preflight response.
摘要:项目中,如果遇到axios跨域请求,这种错误: Access to XMLHttpRequest at 'http://x.x.x:3000/api/add' from origin 'http://localhost:8080' has been blocked by CORS policy: R
阅读全文
To install them, you can run: npm install --save fonts/element-icons.ttf fonts/element-icons.woff
摘要:在使用element-ui按需导入时,出现以下错误: These dependencies were not found: * fonts/element-icons.ttf in ./node_modules/_css-loader@1.0.1@css-loader??ref--6-oneOf-3
阅读全文
vue cli3---elementUI 按需导入(babel.config.js)
摘要:在使用vue cli3脚手架时,需要按需导入element-ui 组件,步骤如下: 1. 安装element-ui npm i element-ui -S 2. 按需导入需要安装,babel-plugin-component npm install babel-plugin-component -D
阅读全文
vue cli2 和vue cli3
摘要:一、 初始化项目 vue cli2初始化项目 vue init webpack my-project vue cli3初始化项目 vue create my-project vue cli3还可以通过 vue ui 命令以图形化界面创建和管理项目: vue ui 上述命令会打开一个浏览器窗口,并以图
阅读全文
vue cli3 和 vue cli4
摘要:最近安装了vue cli4, 和vue cli3做下对比。我自己手动选择的配置, 安装了Router,Vuex 我安装的版本是@vue/cli 4.2.3 一.项目结构 左边为vue cli3, 右边为vue cli4 默认目录结构已更改 src/store.js 改为 src/store/inde
阅读全文
vue --- 6 errors and 0 warnings potentially fixable with the `--fix` option (eslint)
摘要:在创建vue项目中,会选择linter/Formatter,eslint-config-standard "standard"插件代表的是eslint的standard插件都要安装 所以参考一下以下依赖是否安装 eslint babel-eslint eslint-plugin-html eslin
阅读全文
React--Ant Design按需加载
摘要:1. 安装 npm install antd --save 或者 yarn add antd 2. 按需加载方式一:安装 babel-plugin-import npm install babel-plugin-import --save .babelrc or babel-loader optio
阅读全文