摘要:
1、删除源文件后,配置了gzip,当配置gzip删除源文件后,解决前端history问题,就会出现所有的都返回html,请求js、css也会返回html,页面会报错,如下配置即可 location / { root e:/build; index index.html index.htm; gzip 阅读全文
摘要:
.env(项目根目录环境变量文件) PUBLIC_URL:http://cdn.com/ 阅读全文
摘要:
import React from "react"; function demo() { const FormConfig = { labelCol: { span: 8 }, wrapperCol: { span: 16 }, }; const [form] = Form.useForm(); c 阅读全文
摘要:
@media only screen and (min-width: 320px) and (max-width: 359px) { html, body { font-size: 8.51px; } } @media only screen and (min-width: 360px) and ( 阅读全文
摘要:
1、安装vite-plugin-style-import yarn add vite-plugin-style-import -D 2、在项目根目录下的vite.config.js中配置 import { defineConfig } from 'vite' import vue from '@vi 阅读全文
摘要:
一、原型链继承 function a() { this.speack = function () { console.log('第一个元素'); } } function b() { this.ask = function () { console.log('第二个元素'); } } b.proto 阅读全文
摘要:
//手写call Function.prototype.myCall = function (context) { let ctx = context; ctx.fn = this; const args = Array.from(arguments).splice(1); let result = 阅读全文
摘要:
一、js原型定义 函数都有一个原型,通过prototype指向这个原型,通过这个函数创建的实例对象会继承这个原型上面的属性和方法(设置这个实例对象的__proto__),js在它们之间创建一个关联。 二、js原型链定义 通过函数创建出来的对象,默认会有一个__proto__属性指向它继承的构造函数的 阅读全文
摘要:
自定义输入框v-modal,2.0写法 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1. 阅读全文
摘要:
1、函数防抖,在一定时间段不断触发,只会执行最后一次的函数 <body> <button id='btn'>点击</button> <script> //函数防抖,在一定时间段不断触发,只会执行最后一次的函数 function debounce(fn) { let timer = null; ret 阅读全文