elementui resetFields属性未定义 我目前遇到的情况是 this.$refs["ruleForm"].resetFields(); 提示未定义没有这个方法。但是我第二天重新打开项目就又好了。当时报错解决方法是this.$nextTick(() => { this.$refs["ruleForm"].resetFields(); }); 2020-12-08 09:53:41 Vue ·
Vue关闭eslint // vue.config.js 配置文件 module.exports = { lintOnSave: false } 2020-11-27 02:05:11 未分类 Vue ·
Vue路由跳转 1. router-link2. this.$router.push()3. this.$router.replace() (用法同push)4. this.$router.go(n)router-link<router-link :to="{name:'home'}"> <router-link :to="{path:'/home'}"> <router-link :to="{name:'home', params: {id:1}}"> 类似于post,第一次有效,刷新就消失 <router-link :t... 2020-11-13 04:25:22 Vue ·
ElementUI 表单验证// 整个表单验证 this.$refs.dialogRef.validate(()=>{}); // 单个字段 code是字段 this.$refs.dialogRef.validateField('code',()=>{})表单验证rulerules:{ code: [ { required: true, message: "请输入商品编码", trigger: "blur" }, { min: 1, max: 2... 2020-09-26 01:34:44 未分类 Vue ·
Electron-vue 需要运行环境和打包程序 npm i -g electron npm i -g electron-builder 项目安装 vue init simulatedgreg/electron-vue my-project其中--platform是配置打包成什么平台的安装文件,下面是可选的值win系统: win或者win32,即--platform=win或者--platform=win32mac系统:mac或者darwin,即--platform=mac或者--platform=darwinLinux系统:linux, 即--platform=linu... 2020-06-15 12:57:24 Vue ·
Vue中EXCEL的导入导出 import FileSaver from 'file-saver' import XLSX from 'xlsx'导入 <el-upload class="upload-demo" drag action="https://jsonplaceholder.typicode.com/posts/" multiple accept=".xlsx" :on-exceed="exceed" :limit="1" :on-remove="remove... 2020-05-16 10:16:49 Vue ·
Vue截图 https://www.npmjs.com/package/vue-cropper/v/0.4.7npm install vue-cropper 2020-05-14 06:03:30 Vue ·
Vue打印 在vue中使用浏览器的打印功能npm install vue-print-nb import Print from 'vue-print-nb' Vue.use(Print) 第一种: <div id="printTest" > <h1>WISHMELZZZZ</h1> </div> <button v-print="'#printTest'">打印</button> 第二种: <button v-print="printObj">Print local range</bu... 2020-05-14 02:42:51 Vue ·
Vue反向代理 module.exports = { devServer: { proxy: { "/api":{ //项目中的接口 target:"http://xxx.com", // 对应的反向代理的网址 pathRewrite:{ "^/api":"/api" //对应的接口 } } } } 2020-05-13 05:59:57 Vue ·
Vue的地图插件vue-amap https://github.com/ElemeFE/vue-amap使用配置 npm i vue-amap import VueAMap from 'vue-amap'; Vue.use(VueAMap); VueAMap.initAMapApiLoader({ // 高德的key key: 'be2262deadf45267aed6f6e7rty3ba0', // 插件集合 plugin: [ "AMap.Autocomplete", //输入提示插件 "AMap.PlaceSearch", //POI搜索... 2020-05-07 07:14:29 Vue ·
Vue监听器 watch:{ // 参数一:修改后的值; // 参数二:修改之前的值 参数名字:function(newValue,oldValue){ // 操作 } }比如监听每次跳转的路由watch:{ $route(to,from){ console.log(to.path); } }, OR watch: { $route: { handler: function(val, oldVal){ console.log(val); }, // 深度观察监听 ... 2020-04-22 09:29:48 Vue ·