//

js中箭头函数的详细讲解

什么是箭头函数箭头函数是ES6中新增的一种函数形式,它可以更简洁地定义函数。箭头函数的语法如下:

- 阅读全文 -

ES6中Promise的详细讲解

什么是Promise?Promise是一种异步编程的解决方案,它可以让我们更加优雅地处理异步操作。Promise有三种状态:pending(进行中)、fulfilled(已成功)和rejected(已失败)。当Promise处于pending状态时,我们可以注册回调函数来处理Promise的结果。当Promise状态变为fulfilled或rejected时,Promise会调用相应的回调函数。P

- 阅读全文 -

ES6规范详解

ES6是ECMAScript的第6个版本,也被称为ES2015。它是JavaScript的一个重要更新,引入了许多新的语言特性和API。在本文中,我们将深入探讨ES6规范的各个方面。

- 阅读全文 -

Js任意时间戳转换任意时间格式

function formatChinaTime(timestamp, format) { const date = new Date(timestamp); const year = date.getFullYear(); const month = date.getMonth() + 1; const day = date.getDate(); const hour = d

- 阅读全文 -

vue项目scss配置全局变量

// vue.config.js const { defineConfig } = require('@vue/cli-service') module.exports = defineConfig({ transpileDependencies: true, css: { loaderOptions: { sass: {

- 阅读全文 -

uni-app接口封装

// config/index.js module.exports = { baseURL: process.env.NODE_ENV === 'production' ? 'http://yszk.depin.vip/index.php' : '/' }// utils/request.js import { baseURL } from '@/config/index.js'

- 阅读全文 -

PHP随机生成四位字符串

public function RandStr() { $arr1 = array_merge(range('A', 'Z'), range(0, 9), range('a', 'z')); // 生成数组且合并为arr1 shuffle($arr1); // 打乱顺序 $arr2 = array_rand($arr1, 4); // arr1随机取四位生成新数组

- 阅读全文 -