![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
js
QQ2856639881
这个作者很懒,什么都没留下…
展开
-
vue2 获取不到 Vue.prototype.$abc 的一种情况
在 index.vue中的赋值应改为 Vue.prototype.$abc = {.....}然后又在index.vue中 this.$abc = {.........}这样在其他地方使用 this.$abc 获取到的依然是{}原创 2023-02-07 23:50:34 · 837 阅读 · 0 评论 -
promise 和 await
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>...原创 2022-05-02 17:25:31 · 267 阅读 · 0 评论 -
js datetime相关函数 本月本季度本年 下月 下季度 下年第一天
export default { formatNumber: n => { n = n.toString() return n[1] ? n : '0' + n }, formatTime3: date => { const year = date.getFullYear() const month = date.getMonth() + 1 const day = date.getDate() const hour = date.g.原创 2021-06-20 13:40:00 · 286 阅读 · 0 评论 -
js测试题
//1 如何在JS中动态添加/删除对象的属性? 如下文如何删除 user.age?let user = new Object();user.name = 'Anil';user.age = 20;//2 说说对promise 以及 await 的理解, 如何把vue中的http请求包装成promise//3 js Array中 filter、map 如何使用? 两者有何区别//1)筛选value>10的数据 2) 将value的值改成其平方并返回, 希望得到的结..原创 2021-06-05 16:07:06 · 115 阅读 · 0 评论 -
echarts属性的设置(完整大全)
// 全图默认背景 // backgroundColor: ‘rgba(0,0,0,0)’,// 默认色板color: ['#ff7f50','#87cefa','#da70d6','#32cd32','#6495ed', '#ff69b4','#ba55d3','#cd5c5c','#ffa500','#40e0d0', '#1e90ff','#ff6347','#7b68ee','#00fa9a','#ffd700', '#6699FF','#ff6666','#3cb3.原创 2021-02-28 10:32:33 · 340 阅读 · 0 评论 -
js string to json 出错
string to json 有多种方式var obj = eval('(' + str + ')');或者var obj = str.parseJSON();或者var obj = JSON.parse(str);但是对于非标准的json字符串, 比如{name:'name',cnname:'姓名'} 因为key没有引号,使用JSON.parse会报错但用 eval 就可以...原创 2020-08-24 15:51:22 · 209 阅读 · 0 评论 -
swiper 切换到指定slide
1、 如果是指定初始位置,用initialSlidethis.swiper = new Swiper(".swiper-container", { initialSlide: this.curr_index, loop: true, slidesPerView: 1.1, spaceBetween: 2, // pagination: { // el: '.swiper-pagination', // ..原创 2020-06-28 01:37:48 · 2829 阅读 · 0 评论 -
js封装api
1、 http.js import '../js/jquery-3.3.1.min.js' //这个地方居然要如此引用import _url from './config.js'import util from '../utils/util.js'import '../js/jquery-3.3.1.min.js' //这个地方居然要如此引用export default { /** * 传入 headers data */ post: funct...原创 2020-06-08 22:29:38 · 526 阅读 · 0 评论