![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
js
子弹头99
php最好的语言
展开
-
js计算排名
1.假数组:studentList:[{ name:'张三', store:99, ranking:1,},{ name:'李四', store:98, ranking:2,},{ name:'王五', store:98, ranking:3,},{ name:'赵四', store:96, ranking:4,},{ name:'张好', store:96, ranking转载 2020-06-24 13:58:12 · 1984 阅读 · 0 评论 -
js问题记录
记录一下问题,new完promise之后执行then打印结果,但是他是在最后执行的是a.then(res => console.log('res' + res))异步吧这个!所以她是顺序执行完之后才执行的。看异步同步,回调,和他们之间的关系(理解),js进程线程(了解)...原创 2020-06-14 15:52:13 · 124 阅读 · 0 评论 -
js 计时器
<template> <div class="wrapper"> <h1 id=mytime>{{str}}</h1> <button id="stop" name="button" @click="stop">stop</button> <button id="start" name="button" @click="start">start</button> <bu.转载 2020-06-05 23:15:56 · 140 阅读 · 0 评论 -
在数组对象中,按照字段进行排序
var testArr = [ { id: 1, name: 'cs', age: 18 }, { id: 2, name: 'zs', age: 15 }, { id: 3, name: 'ls', age: 20 }, { id: 4, name: 'ww', age: 16 } ] function toSort(propertyName) { return function(a, b) { ...原创 2020-05-30 22:52:48 · 580 阅读 · 0 评论 -
小程序请求时使用的加载中操作
wx.showLoading({ title: '加载中...',}) wx.request({ url: '', success(res){设置 关闭记载中,关闭下拉 setTimeout(function () { wx.hideLoading() wx.stopPullDownRefresh() }, 500)}, fail(){}, complete(){ }})...原创 2020-05-26 17:20:57 · 566 阅读 · 0 评论 -
js 数组对象的合并
var res = [{id: 28}, {id: 28}, {id: 28}, {id: 28}]; var data = [{id: 29}, {id: 29}, {id: 29}, {id: 29}]; res.map((value) => { console.log(value) data = data.concat(value); }); console.log(data)原创 2020-05-26 10:34:33 · 222 阅读 · 0 评论 -
Vue使用scope修改传递的数据时,源数据也发生变化解决办法(深拷贝浅拷贝)
修改试题列表里面的试题你会发现直接使用scope.row形成修改数据的变量后。 this.questionsEditData = scope.row当你去修数据之后,会发现源数据也会发生变化。红色框框里面的数据也会发生变化,就是因为,我们赋值利用的是浅拷贝,指向的是地址,所以修改后源数据也发生了变化。那么怎么解决这个问题呢?let row = JSON.parse(JSON.stringify(scope.row))this.questionsEditData..原创 2020-05-23 11:52:34 · 4053 阅读 · 0 评论 -
小程序中回调函数(callback)的理解
什么是回调函数://callback是一个函数A callback is a function //作为另一个函数的参数that is passed as an argument to another function and //当父函數执行完成之后,它(回调函数)才被执行is executed after its parent function has completed....原创 2020-04-25 12:21:17 · 5691 阅读 · 0 评论 -
Js调试
原创 2019-10-20 16:56:05 · 101 阅读 · 0 评论 -
js中应用xml
xml文件内容:<?xml version="1.0" encoding="UTF-8"?><root> <name>周林林</name> <age>18</age> <skill>唱歌</skill></root>php后台内容:<?php//告...原创 2019-09-08 20:31:20 · 152 阅读 · 0 评论 -
ajax学习笔记
s1 服务器返回xml在后台php文件中写headerheader('content-type:text/xml;charset=utf-8');2服务器返回json在后台php文件中写headerheader('content-type:text/json;charset=utf-8');3创建对象 ulDom = documenr.createElemen...原创 2019-09-08 19:54:16 · 63 阅读 · 0 评论 -
js一些知识点
1 删除数组 var arr = [12, 3, 45, 4]; console.log(arr.length);//4 arr.length=0 console.log(arr.length)//02 获得时间戳 var dt = new Date(); console.log(dt); console.log(dt.valueOf...原创 2019-08-30 21:53:45 · 71 阅读 · 0 评论 -
JS以对象的方式对数组进行排序
function MyArray() { this.mySort = function (arr) { for (i = 0; i < arr.length; i++) { for (j = 0; j < arr.length - i; j++) { if (arr[j]...原创 2019-08-30 07:51:30 · 69 阅读 · 0 评论 -
Js数据类型
js有6种数据类型number,string,boolean,null,undefined,objectnubmer var num = 10;string var str = ""; var str = "abcdef";boolean var bool1 = true; var bool2 = false;null ...原创 2019-07-21 18:19:20 · 67 阅读 · 0 评论