上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 15 下一页
摘要: 箭头函数会捕获上下文的this,将其转化为自己this,而普通函数不会。 // 调用方式 this指向 // 普通函数调用 window // 构造函数调用 实例对象 原型对象里面的方法也指向实例对象 // 对象方法调用 该方法所属对象 // 事件绑定方法 绑定事件对象 // 定时器函数 windo 阅读全文
posted @ 2021-12-28 14:04 ajaXJson 阅读(18) 评论(0) 推荐(0) 编辑
摘要: 1.导入loading组件 import {Loading} from 'element-ui' 2.main.js 声明请求拦截与响应拦截 let loadingInstance = nullaxios.interceptors.request.use(config =>{ //展示loading 阅读全文
posted @ 2021-11-18 21:09 ajaXJson 阅读(62) 评论(0) 推荐(0) 编辑
摘要: 一、例:vue项目运行的地址:htpp://localhost:8080/ API接口项目运行的地址:http://www.escook.cn/api/users 由于当前的 API 接口没有开启 CORS 跨域资源共享,因此默认情况下,上面的接口无法请求成功! 通过代理解决接口的跨域问题 把 ax 阅读全文
posted @ 2021-11-15 17:16 ajaXJson 阅读(316) 评论(0) 推荐(0) 编辑
摘要: Vue3 import {createApp} from 'vue'import App from './App.vue'//1.导入axiosimport axios from 'axios'const app = create(App)//2.配置请求根路径axios.defaults.base 阅读全文
posted @ 2021-11-15 17:14 ajaXJson 阅读(269) 评论(0) 推荐(0) 编辑
摘要: instanceof 运算符用于检测构造函数的 prototype 属性是否出现在某个实例对象的原型链上。 object instanceof constructor object:某个实例对象constructor`:某个构造函数 用来检测 constructor.prototype是否存在于参数 阅读全文
posted @ 2021-11-09 15:06 ajaXJson 阅读(30) 评论(0) 推荐(0) 编辑
摘要: main.js Vue.config.productionTip = false// app.directive('focus',{// mounted(el){// el.focus()// },// updated(el){// el.focus()// }// })app.directive( 阅读全文
posted @ 2021-10-22 15:15 ajaXJson 阅读(32) 评论(0) 推荐(0) 编辑
摘要: .prevent 阻止默认行为(阻止a链接的跳转、阻止表单的提交等) .stop阻止事件冒泡 .capture以捕获模式触发当前的事件处理函数 .once 绑定的事件只触发一次 .self 只有再event.target是当前元素自身时触发事件处理函数 阅读全文
posted @ 2021-10-08 17:01 ajaXJson 阅读(21) 评论(0) 推荐(0) 编辑
摘要: 宏任务 异步Ajax请求 setTimeout、setInterval 文件操作 其他宏任务 微任务 Promise.then、.catch和.finally process.nextTick 其他微任务 执行机制: setTimeoit(function(){console.log('1')})n 阅读全文
posted @ 2021-10-08 11:52 ajaXJson 阅读(186) 评论(0) 推荐(0) 编辑
摘要: console.log('A')async function getAllFile(){console.log('B')const r1 = await thenFs.readFile('./files/1.txt','utf8')const r2 = await thenFs.readFile(' 阅读全文
posted @ 2021-10-08 11:16 ajaXJson 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 如果给当前组件的 style 节点添加了 scoped 属性,则当前组件的样式对其子组件是不生效的。如果想让某些样 式对子组件生效,可以使用 /deep/ 深度选择器(vue2.0用法)。 <style lang="less" scoped>.label-box { display: flex; j 阅读全文
posted @ 2021-09-30 10:35 ajaXJson 阅读(185) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 15 下一页