
Vue
My_Java_Life
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
封装axios
封装axios原创 2022-06-29 17:48:39 · 238 阅读 · 1 评论 -
vue-cli4中Stylelint配置
文章目录安装配置StylelintWebstorm中stylelint自动修复设置快捷键 安装配置Stylelint npm i stylelint stylelint-config-standard stylelint-order stylelint-config-rational-order stylelint-declaration-block-no-ignored-properties -D package.json "stylelint": "^13.8.0", "stylelint-confi原创 2021-11-15 17:05:03 · 1648 阅读 · 0 评论 -
Vue中将px自动转化为rem
安装所需插件 npm i amfe-flexible -S npm i postcss-plugin-px2rem -D main.j中引入 import 'amfe-flexible'; 对 postcss-plugin-px2rem 插件自定义配置 vue.config.js 中添加如下配置 module.exports = { css: { loaderOptions: { postcss: { plugins: [ requ.原创 2020-12-03 16:10:28 · 1391 阅读 · 0 评论 -
移动端呼出键盘时遮挡住输入框
<input type="text" @click="scrollEle" v-model="value"> scrollEle (e) { let ele = e.target window.onresize = function () { ele.scrollIntoView({ behavior: 'smooth' }); } } scrollIntoView 说明 还看到有些人说scrollIntoViewIfNeeded也行,但官网中有段说明 ...原创 2020-09-09 10:50:37 · 214 阅读 · 0 评论 -
封装axios
import axios from 'axios'; import vMessage from '@/components/messageTips'; import qs from 'qs'; import router from '@/router'; const service = axios.create({ // 请求超时时间 // timeout: 3000 }); // 解决跨域时的OPTION请求 service.defaults.headers['Content-Type'] =原创 2020-07-17 23:09:29 · 196 阅读 · 0 评论 -
Vue重新加载被keep-alive的组件
一个页面由3个组件构成,现只要刷新C组件,且C组件已经被keep-alive缓存 思路:先把C组件从keep-alive中去除,记录下当前页面的路径和缓存组件的名称(方便重新加载后使用),再路由到一个空白页面Refresh.vue // 从keep-alive中去除 this.$store.commit('removeKeepAlivePage', '移除组件缓存'); // 转到空白页 this.$router.replace('/refresh'); 在Refresh.vue初始化时直接路由到之前记.原创 2020-06-22 15:24:59 · 2531 阅读 · 0 评论 -
搭建vue框架(二):项目配置
项目配置使WebStorm识别路径别名安装ElementUI安装babel禁用ESLint配置ESLint规则 使WebStorm识别路径别名 使用WebStorm时,别名@符号无法识别,ctrl+鼠标左键无法跳转 解决方法 安装ElementUI npm i element-ui -S main.js中使用 import ElementUI from 'element-ui' import 'element-ui/lib/theme-chalk/index.css'; // 默认主题 // impo原创 2020-05-28 20:45:16 · 297 阅读 · 0 评论 -
搭建vue框架(一):创建项目
搭建vue框架安装vue-cli创建项目选择配置 安装vue-cli npm install -g @vue/cli 创建项目 vue create vue-demo 选择配置 Please pick a preset: Manually select features --选择Manually Check the features needed for your project 选择 Babel, Router, Vuex, CSS Pre-processors, Linter Use his原创 2020-05-13 10:54:10 · 277 阅读 · 0 评论