摘要: 1、使用concat(原数组不变) var new = old1.concat(old2) 2、使用for循环(原数组变化) for (var i=0; i<old2.length; i++) { old1.push(old2[i]) } 3、使用apply(原数组变化) old1.push.app 阅读全文
posted @ 2020-02-01 16:28 山根花理 阅读(231) 评论(0) 推荐(0)
摘要: 滚动检测 // 监听滚动事件 scrolling: any ngOnInit() { this.scrolling = fromEvent(window, 'scroll') // fromEvent(element,event) .subscribe((event) => { // 订阅 this 阅读全文
posted @ 2020-01-27 21:29 山根花理 阅读(1119) 评论(0) 推荐(0)
摘要: // 计算当前图片位置 count = 0 timeset() { this.count += -100 if (this.count == -700) { this.count = 0 } } // 滑动主要函数 slide() { const imgList = this.sliderIMG.n 阅读全文
posted @ 2020-01-24 22:17 山根花理 阅读(143) 评论(0) 推荐(0)
摘要: @ViewChild('sliderIMG', { static: true }) sliderIMG: ElementRef // 第二个值不知道是怎么用的 const imgList = this.sliderIMG.nativeElement.getElementsByTagName('li' 阅读全文
posted @ 2020-01-24 22:13 山根花理 阅读(508) 评论(0) 推荐(0)
摘要: <div *ngFor="let product of products"> *ngFor循环遍历products数组(类似vue的v-for) <a [title]="product.name + ' details'"> {{ product.name }} </a> [title]数据绑定(类 阅读全文
posted @ 2020-01-21 15:42 山根花理 阅读(153) 评论(0) 推荐(0)
摘要: const http = require('http') const url = require('url') const querystring = require('querystring') http.createServer((require,response)=>{ // GET请求 le 阅读全文
posted @ 2020-01-19 20:55 山根花理 阅读(166) 评论(0) 推荐(0)
摘要: 在入口文件index.php中添加 header('Access-Control-Allow-Headers:x-requested-with,content-type'); header('Access-Control-Allow-Origin:http://localhost:8888'); 阅读全文
posted @ 2020-01-17 15:38 山根花理 阅读(129) 评论(0) 推荐(0)
摘要: 参考文章:https://www.cnblogs.com/wolf-sun/p/6878868.html 用$http的方式发送post请求时发现发送值一直为null,需要配置一下transformRequest 代码如下 function (obj) { var str = []; for (va 阅读全文
posted @ 2020-01-14 20:35 山根花理 阅读(187) 评论(0) 推荐(0)
摘要: 1)在module文件夹下建立一个新的模块文件夹User 2)在新建的User文件夹下建立3个文件夹,名字分别为config、src、view 3)建立一个Module.php文件,此文件用来加载当前模块。Module.php代码如下 1 <?php 2 namespace User;//命名空间设 阅读全文
posted @ 2020-01-14 14:29 山根花理 阅读(203) 评论(0) 推荐(0)