上一页 1 ··· 3 4 5 6 7 8 9 10 11 下一页

2022年9月23日

拖拽排序

摘要: <!doctype html> <html> <head> <meta charset="UTF-8"> <title>拖拽排序</title> <style> ul { list-style: none; margin: 200px; font-size: 0; } .ele { font-siz 阅读全文

posted @ 2022-09-23 13:44 马玉豪 阅读(67) 评论(0) 推荐(0)

2022年9月22日

async/await

摘要: async: 作为一个关键字放在函数的前面,表示该函数是一个异步函数,意味着该函数的执行不会阻塞后面代码的执行 异步函数的调用跟普通函数一样 async function fn() { console.log('Hello world!'); } console.log(fn().construct 阅读全文

posted @ 2022-09-22 12:00 马玉豪 阅读(26) 评论(0) 推荐(0)

2022年9月21日

setup

摘要: 什么是setup setup是vue3新增的生命周期函数,setup的加入就是为了让vue3使用组合式API(Composition API)。使用组合式API更符合大型项目的开发,通过setup可以将该部分抽离成函数,让其他开发者就不用关心该部分逻辑。setup位于beforeCreated之前, 阅读全文

posted @ 2022-09-21 16:18 马玉豪 阅读(1272) 评论(0) 推荐(0)

请求封装

摘要: // const app = getApp() let isDev=true;//是否开发环境 let host = 'https://xs2b.kktijian.com/api' let fileHost='https://xs2b.kktijian.com' let versions = __w 阅读全文

posted @ 2022-09-21 10:45 马玉豪 阅读(30) 评论(0) 推荐(0)

小程序自定义组件

摘要: 1. 创建自定义组件 一个组件也类似于一个页面,由json wxml wxss js 4个文件组成 可以在一个新文件夹上右键新建component,可以直接生成这四个文件 其次在json配置文件中,需要将component属性配置成true,用上面的方法创建的默认设置好了 然后在组件的wxml 和w 阅读全文

posted @ 2022-09-21 09:51 马玉豪 阅读(298) 评论(0) 推荐(0)

2022年9月20日

表头与表格对齐

摘要: function tablealign(RetSFXM, RetSFFS) { var lengthTR = $("#tabledata tr:eq(0) td").length $("#tablehead colgroup").remove(); $("#tablehead tr:eq(0)"). 阅读全文

posted @ 2022-09-20 16:53 马玉豪 阅读(55) 评论(0) 推荐(0)

打开窗口

摘要: function (btn) { var cloneDom = $("<div class='allPopModal'><div class='allModalZhezhao'></div></div>"); cloneDom.append($(btn)) $("body").append(clon 阅读全文

posted @ 2022-09-20 16:45 马玉豪 阅读(76) 评论(0) 推荐(0)

分页

摘要: //分页 $(document).on("click", ".pageBox>i", function () { //当前页数 var activeDom = $(this).siblings(".pageFile").find(".active"); var nowPage = activeDom 阅读全文

posted @ 2022-09-20 16:35 马玉豪 阅读(36) 评论(0) 推荐(0)

数组去重

摘要: 一、利用 ES6 Set 去重(ES6 中最常用) function unique (arr) { return Array.from(new Set(arr)) } var arr = [1,1,'true','true',true,true,15,15,false,false, undefine 阅读全文

posted @ 2022-09-20 16:09 马玉豪 阅读(18) 评论(0) 推荐(0)

防抖和节流

摘要: 一、防抖 触发高频事件后n秒内函数只会执行一次,如果n秒内高频事件再次被触发,则重新计算时间 思路:动作绑定事件,动作发生后一定时间后触发事件,在这段时间内,如果该动作又发生,则重新等待一定时间再触发事件。 function debounce(fn) { let timeout = null; // 阅读全文

posted @ 2022-09-20 15:22 马玉豪 阅读(30) 评论(0) 推荐(0)

上一页 1 ··· 3 4 5 6 7 8 9 10 11 下一页

导航