上一页 1 2 3 4 5 6 ··· 15 下一页
摘要: get const http = require('http'); const url = require('url'); const host = 'http://localhost:3000'; http.createServer(function (req, res) { const { se 阅读全文
posted @ 2021-10-28 10:19 zhoulixue 阅读(43) 评论(0) 推荐(0) 编辑
摘要: index.ejs <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" c 阅读全文
posted @ 2021-10-28 09:37 zhoulixue 阅读(36) 评论(0) 推荐(0) 编辑
摘要: 1. 工具函数 module/file.js 读取文件数据 const fs = require('fs'); const readFile = (path) => new Promise((resolve) => { fs.readFile(path, (err, data) => { resol 阅读全文
posted @ 2021-10-21 10:07 zhoulixue 阅读(351) 评论(0) 推荐(0) 编辑
摘要: 写数据流 const fs = require('fs'); let str = ''; for (let i = 0; i < 1e4; i++) { str += `写入数据${i}\n`; } const writeStream = fs.createWriteStream('./data/o 阅读全文
posted @ 2021-10-20 20:11 zhoulixue 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 创建一个upload文件夹 const fs = require('fs'); // 创建文件夹 const mkdir = (path) => new Promise((resolve) => { fs.mkdir(path, (err) => { resolve({ err }); }); }) 阅读全文
posted @ 2021-10-20 10:01 zhoulixue 阅读(52) 评论(0) 推荐(0) 编辑
摘要: 检测是文件还是目录 const fs = require('fs'); fs.stat('./html', (err, stat) => { if (err) { console.log(err); return; } const isDirectory = stat.isDirectory(); 阅读全文
posted @ 2021-10-19 09:57 zhoulixue 阅读(73) 评论(0) 推荐(0) 编辑
摘要: new URL(input, [base]) base验证input的origin是否符合预期 let myUrl = new URL('test/index.html', 'https://example.com'); // https://example.com/test/index.html 阅读全文
posted @ 2021-10-11 09:48 zhoulixue 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 适配双端 <video class="video" muted preload="none" webkit-playsinline playsinline autoplay > <source type="application/x-mpegURL" :src="feed.stream_url"> 阅读全文
posted @ 2021-09-15 09:48 zhoulixue 阅读(45) 评论(0) 推荐(0) 编辑
摘要: 设置 input[type=search] 可以在点击输入框时,让弹出的软键盘显示搜索按钮。 对于安卓手机,可以直接使用此特性: <input class="input" type="search"> 但是在ios上不显示搜索按钮,ios必须放到form中且加action事件才能显示搜索按钮: <f 阅读全文
posted @ 2021-09-15 09:44 zhoulixue 阅读(1334) 评论(0) 推荐(0) 编辑
摘要: 1. 组件注册懒加载 (1)全局注册 Vue.component('AsyncComponent', ()=> import('./AsyncComponent.vue')) (2)局部注册 new Vue({ components: { AsyncComponent: () => import(' 阅读全文
posted @ 2021-03-11 16:49 zhoulixue 阅读(204) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 15 下一页