摘要: 一、本地vue项目配置IP地址访问,可以让同局域网内的同事预览 解决:在package.json文件中 dev中配置 --host 本机IP "scripts": { "dev": "webpack-dev-server --inline --progress --config build/webp 阅读全文
posted @ 2019-12-25 17:21 张小中 阅读(820) 评论(1) 推荐(0) 编辑
摘要: https://blog.csdn.net/lq313131/article/details/127173938 import axios from 'axios' import Qs from 'qs' let qs = Qs // 创建axios实例对象 let instance = axios 阅读全文
posted @ 2023-04-26 16:42 张小中 阅读(16) 评论(0) 推荐(0) 编辑
摘要: { "[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[html]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[vue]": 阅读全文
posted @ 2023-04-20 14:10 张小中 阅读(82) 评论(0) 推荐(0) 编辑
摘要: Vue无法检测实例被创建时不存在于data中的变量 new Vue({ data:{}, template: '<div>{{message}}</div>' }) this.message = 'Hello world !' // `message` 不是响应式的页面不会发生变化 解决: new 阅读全文
posted @ 2023-04-04 16:00 张小中 阅读(109) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi 阅读全文
posted @ 2023-03-24 15:06 张小中 阅读(20) 评论(0) 推荐(0) 编辑
摘要: iview 两个form表单v-if显示隐藏,formItem校验不生效的问题 解决:两个form表单 用的变量控制显示隐藏,会有校验失效问题,解决办法给formItem加上key 阅读全文
posted @ 2023-02-14 20:25 张小中 阅读(201) 评论(0) 推荐(0) 编辑
摘要: Error in nextTick: "TypeError: Cannot read properties of undefined (reading 'nodeName')" 当遇见这种问题时,可以先排查 v-for 循环中的key 值是否写的合理 : :key='`${index}-${Math 阅读全文
posted @ 2023-02-14 15:08 张小中 阅读(307) 评论(0) 推荐(0) 编辑
摘要: iview 在表单中的input框获取焦点,按下 enter 键,整个页面都会刷新。 在 form 标签中添加 @submit.native.prevent 表示阻止表单默认提交 .native 表示对一个组件绑定系统原生事件 .prevent 表示提交以后不刷新页面 @keyup.native.e 阅读全文
posted @ 2022-12-14 09:55 张小中 阅读(376) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="Access-Control-Allow-Origin" content="*"> <title>Title</title> </head 阅读全文
posted @ 2022-11-02 11:32 张小中 阅读(564) 评论(0) 推荐(0) 编辑
摘要: 1、Vue中computed和watch computed: { full() { return this.a + this.b } fullName: { //计算属性默认只有 getter,不过在需要时你也可以提供一个 setter vm.fullName = 'John Doe' 时,sett 阅读全文
posted @ 2022-10-14 16:58 张小中 阅读(30) 评论(0) 推荐(0) 编辑
摘要: 1、空心文字实现思路 思路:融合背景+文字阴影 <style> body { background: #000;text-align: center;} h1 {font-size: 90px;color: #000; text-shadow: 1px 0 #fff, 1px 1px #fff, 1 阅读全文
posted @ 2022-09-14 14:35 张小中 阅读(12) 评论(0) 推荐(0) 编辑
摘要: directives: { preventReClick: { inserted(el, binding) { el.addEventListener('click', () => { if (!el.disabled) { el.disabled = true setTimeout(() => { 阅读全文
posted @ 2022-09-01 16:20 张小中 阅读(18) 评论(0) 推荐(0) 编辑
摘要: // 区分ie浏览器和chrome浏览器实现修改文件名 function downloadFile(url, fileName, encode, suffix, noHomologous) { let urlPathload = url if (encode) { const tmpFileName 阅读全文
posted @ 2022-09-01 10:26 张小中 阅读(27) 评论(0) 推荐(0) 编辑
摘要: 循环遍历出来的表单的 :prop 需要制定当前index拼接,单独指定 :rules <Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="150"> <div class="addRec 阅读全文
posted @ 2022-08-23 17:08 张小中 阅读(445) 评论(0) 推荐(0) 编辑
摘要: https://blog.csdn.net/yin_you_yu/article/details/116261304 阅读全文
posted @ 2022-08-23 16:58 张小中 阅读(321) 评论(0) 推荐(0) 编辑
摘要: function isChn(str) { var reg = /^[\u4E00-\u9FA5]+$/; if (!reg.test(str)) { alert("不全是中文"); return false; } else { alert("全是中文"); return true; } } fun 阅读全文
posted @ 2022-07-08 17:28 张小中 阅读(43) 评论(0) 推荐(0) 编辑
摘要: 1、作用域和值类型引用类型的传递 var num1 = 44; var num2 = 55; function getNum(num, num1) { // 当传参进来时,相当于声明了两个变量,并且被赋值两个实参 // var num = num1 // var num1 = num2 num = 阅读全文
posted @ 2022-06-15 11:02 张小中 阅读(17) 评论(0) 推荐(0) 编辑
摘要: 一个webpack的api,通过执行require.context函数获取一个特定的上下文,主要用来实现自动化导入模块,在前端工程中,如果遇到从一个文件夹引入很多模块的情况,可以使用这个api,它会遍历文件夹中的指定文件,然后自动导入,使得不需要每次显式的调用import导入模块 require.c 阅读全文
posted @ 2022-03-21 19:38 张小中 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 1、使用 pre 标签 <el-form-item label="描述:"> <pre>{{ desc }}</pre> </el-form-item> 2、添加 style=“white-space: pre-wrap” <el-form-item label="描述:"> <p style="w 阅读全文
posted @ 2022-02-28 16:19 张小中 阅读(1006) 评论(0) 推荐(0) 编辑
摘要: checkWH(file) { console.log(this.info.templateName, 'templateNametemplateNametemplateNametemplateName'); if (this.info.templateName == 1) { return thi 阅读全文
posted @ 2022-02-17 13:41 张小中 阅读(73) 评论(0) 推荐(0) 编辑
摘要: // 上移 moveUp(index) { console.log(index, 'moveUp'); if (index > 0) { let update = this.list[index - 1] this.list.splice(index - 1, 1) this.list.splice 阅读全文
posted @ 2022-01-26 16:18 张小中 阅读(60) 评论(0) 推荐(0) 编辑
摘要: iframe 内嵌页面 传参 //父页面触发this.$refs.mainIframe.contentWindow.postMessage(this.showIndex, '*') //子页面iframe 接收 mounted() { let _this = this window.addEvent 阅读全文
posted @ 2022-01-13 10:55 张小中 阅读(274) 评论(0) 推荐(0) 编辑
摘要: directives: { preventReClick: { inserted(el, binding) { el.addEventListener('click', () => { if (!el.disabled) { el.disabled = true setTimeout(() => { 阅读全文
posted @ 2022-01-12 17:39 张小中 阅读(64) 评论(0) 推荐(0) 编辑
摘要: <br><br><br>//全屏按钮 video::-webkit-media-controls-fullscreen-button { display: none; } //播放按钮 video::-webkit-media-controls-play-button { display: none 阅读全文
posted @ 2022-01-09 19:32 张小中 阅读(3079) 评论(0) 推荐(1) 编辑
摘要: // 区分ie浏览器和chrome浏览器实现修改文件名 function downloadFile(url, fileName) { axios({ method: 'get', url: url, // data: encryptList.Encrypt(JSON.stringify(params 阅读全文
posted @ 2022-01-05 16:07 张小中 阅读(298) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi 阅读全文
posted @ 2021-11-01 13:58 张小中 阅读(47) 评论(0) 推荐(0) 编辑
摘要: { // vscode默认启用了根据文件类型自动设置tabsize的选项 "editor.detectIndentation": false, // 重新设定tabsize "editor.tabSize": 2, // #值设置为true时,每次保存的时候自动格式化;值设置为false时,代码格式 阅读全文
posted @ 2021-10-27 14:52 张小中 阅读(733) 评论(0) 推荐(0) 编辑
摘要: function downloadFile(url, fileName) { axios({ method: 'get', url: url, // data: encryptList.Encrypt(JSON.stringify(params)), // data: params, respons 阅读全文
posted @ 2021-09-13 16:05 张小中 阅读(171) 评论(0) 推荐(0) 编辑
摘要: Object.definePropety(obj , prop , descriptor) obj:要修改的对象 prop:要修改的对象的属性 descriptor:{ value: 设置属性的值,默认为undefined writable: 值是否可以重写 true\false 默认为false 阅读全文
posted @ 2021-09-06 09:07 张小中 阅读(93) 评论(0) 推荐(0) 编辑
摘要: Usage: cgr [options] [command] Commands: ls List all the registries use <registry> [type] Change registry to registry. type n or y add <registry> <url 阅读全文
posted @ 2021-08-20 16:08 张小中 阅读(329) 评论(0) 推荐(0) 编辑
摘要: 在css3中新增了width的属性值:max-content;min-content和fit-content、fill-availablea,用来实现以内容为主的尺寸计算方式。 1、fill-available表示撑满可用空间(包括高度,宽度) 2、fit-content表示宽度缩小到内容的宽度 3 阅读全文
posted @ 2021-08-12 10:11 张小中 阅读(69) 评论(0) 推荐(0) 编辑
摘要: 1、单行 If-Else 语句 const age = 12; let ageGroup; // LONG FORM if (age > 18) { ageGroup = "An adult"; } else { ageGroup = "A child"; } // SHORTHAND ageGro 阅读全文
posted @ 2021-08-05 15:24 张小中 阅读(44) 评论(0) 推荐(0) 编辑
摘要: css 中不能同时使用这两个属性,禁止点击可以用js代替 <div class="proBox" :class="[ { checked: checkProduct == item.buildingId }, { hui: !item.unitCount }, ]" v-for="item in p 阅读全文
posted @ 2021-07-07 09:12 张小中 阅读(1868) 评论(0) 推荐(0) 编辑
摘要: 一、upload的使用 <Upload :action="importParameterExcel" :format="['xlsx','xls','XLS','XLSX']" ref="upload" name="excelFile" //请求接口的参数的名字 :headers="uploadHe 阅读全文
posted @ 2021-04-21 15:03 张小中 阅读(679) 评论(0) 推荐(0) 编辑
摘要: performance.navigation.type(该属性返回一个整数值,表示网页的加载来源,可能有以下4种情况): 0:网页通过点击链接、地址栏输入、表单提交、脚本操作等方式加载,相当于常数performance.navigation.TYPE_NAVIGATE。 1:网页通过“重新加载”按钮 阅读全文
posted @ 2021-04-21 14:55 张小中 阅读(2062) 评论(0) 推荐(0) 编辑
摘要: let routeData = this.$router.resolve({ path: '/home', query: { id: 1 } }); window.open(routeData.href, '_blank'); 阅读全文
posted @ 2021-04-16 11:06 张小中 阅读(416) 评论(0) 推荐(0) 编辑
摘要: 七种JS数据类型 六种基本类型:string、number、boolean、null、undefined、symbol(ES6新增) 一种引用数据类型:boject、array、function // 1、symbol函数前不能使用new关键字,否则会报错,这是因为symbol是原始数据类型,而不是 阅读全文
posted @ 2021-02-22 17:56 张小中 阅读(687) 评论(0) 推荐(0) 编辑
摘要: 判断是否是原生 navigator.userAgent浏览器检测 isNative() { let equipmentType = ""; let agent = navigator.userAgent.toLowerCase(); let android = agent.indexOf("andr 阅读全文
posted @ 2021-02-18 16:39 张小中 阅读(1284) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>记录</title 阅读全文
posted @ 2021-01-20 16:59 张小中 阅读(172) 评论(0) 推荐(0) 编辑
摘要: <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.0.js"></script> //先引入微信js-sdk wx.miniProgram.navigateTo({url:'/pages/ind 阅读全文
posted @ 2021-01-15 10:44 张小中 阅读(745) 评论(0) 推荐(0) 编辑
摘要: 在app端内嵌页面中调用vue中的函数时,拿不到methods中定义的函数,需要将Vue项目methods中的方法在mounted中暴露在window上 mounted() { window["shareInfo"] = () => { this.shareInfo(); }; } methods: 阅读全文
posted @ 2021-01-05 14:19 张小中 阅读(1533) 评论(0) 推荐(0) 编辑