摘要: 1 setup() { 2 const store = useStore() 3 4 const sCounter = computed(() => store.state.counter) 5 6 // 都是函数 7 const storeStateFns = mapState(['counter 阅读全文
posted @ 2022-03-19 15:40 Vuex_Joe 阅读(157) 评论(0) 推荐(0)
摘要: 1 function retBytes(str){ 2 let num=str.length; 3 for(let i=0;i<str.length;i++){ 4 if(str.charCodeAt(i)>255) num++; 5 } 6 return num; 7 } 个人理解:把字节长度都看 阅读全文
posted @ 2020-12-09 21:51 Vuex_Joe 阅读(125) 评论(0) 推荐(0)
摘要: 方法一、constructor 定义:constructor属性返回对创建此对象的数组函数的引用。 现在控制台定义一个空数组和空对象 然后分别输出对应的属性 方法二、instanceof 定义:instanceof运算符,用于检测构造函数的prototype属性是否出现在某个实例对象的原型链中。 方 阅读全文
posted @ 2020-12-09 12:46 Vuex_Joe 阅读(145) 评论(0) 推荐(0)
摘要: <script> //缓冲运动原理 //距离目标远速度快 //距离目标近速度慢 //速度与距离成正比 function startMove() { var oDiv = document.querySelector('.box1'); setInterval(function () { //回顾:c 阅读全文
posted @ 2020-12-07 14:38 Vuex_Joe 阅读(54) 评论(0) 推荐(0)
摘要: 1、css方法是jq框架提供给匹配节点添加行内样式语法:$('div').css('color','red');第一个参数,匹配节点添加样式的名字第二个参数,匹配节点添加样式的属性值注意:这种写法不常用,因为只能给元素设置一个样式,如果多个样式,要多次调用函数 常用的写法为在函数中使用json传值, 阅读全文
posted @ 2020-12-06 20:15 Vuex_Joe 阅读(23) 评论(0) 推荐(0)
摘要: <!-- <script> //extend inherit(Target,Origin) //inherit使用 Father.prototype.lastName = 'He'; function Father() {} function Son() {} function inherit(Ta 阅读全文
posted @ 2020-12-06 16:00 Vuex_Joe 阅读(68) 评论(0) 推荐(0)