随笔分类 - 前端
摘要:1、在 vite.config.js 中添加(ts版本则为 vite.config.ts) base: './' 2、将路由模式改为 hash 模式 history: createWebHashHistory() 3、注意检查路由文件需要由函数导入 (我的是未使用箭头函数导入,本地运行正常,但部署后
阅读全文
摘要:table { text-align: left; position: relative; border-collapse: collapse; } thead th { text-align: center; } th { position: sticky; background-color: #
阅读全文
摘要:theme = { // 全图默认背景 // backgroundColor: ‘rgba(0,0,0,0)’, // 默认色板 color: ['#ff7f50', '#87cefa', '#da70d6', '#32cd32', '#6495ed', '#ff69b4', '#ba55d3',
阅读全文
摘要:/*! * jquery.base64.js 0.1 - https://github.com/yckart/jquery.base64.js * Makes Base64 en & -decoding simpler as it is. * * Based upon: https://gist.g
阅读全文
摘要:$("input[type*=text]").each(function(){ var oldValue=$(this).val(); $(this).focus(function(){ if($(this).val()==oldValue){ $(this).val(''); } }) .blur
阅读全文
摘要:const accountInfo = wx.getAccountInfoSync(); console.log(accountInfo) switch (accountInfo.miniProgram.envVersion) { case 'develop': console.log('开发版')
阅读全文
摘要:普通的英文半角空格   普通的英文半角空格但不换行     中文全角空格(一个中文宽度)   en空格 (半个中文宽度)     em空格 (一个中文宽度)     四分之一em空格 (四分之一中文宽
阅读全文
摘要:测试代码 <template> <div class="container"> <span>This Test</span> </div> </template> <script> export default { name: "Test", data() { return { arr: [{ a:
阅读全文
摘要:配置快捷键与PhpStorm一致(自用版本) [ //原配置更改 //打开收藏菜单 {"key":"alt+shift+p","command": "workbench.action.fav.menu"}, //反回车,即把光标前内容移到下一行 {"key":"ctrl+enter","comman
阅读全文
摘要:<!DOCTYPE html><html><head> <meta charset="utf-8"> <title>地理位置测试</title> <script type="text/javascript" src="http://api.map.baidu.com/api?v=1.3"></scr
阅读全文
摘要:官网 https://www.swiper.com.cn/ 安装依赖 npm install swiper vue-awesome-swiper --save 直接在页面中使用 <template> <swiper ref="mySwiper" :options="swiperOptions"> <
阅读全文
摘要:HTML <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>背景图片拉伸铺满页面</title> <link type="text/css" rel="stylesheet" href="img.css"/> </head> <b
阅读全文
摘要:更换国内源 npm config set registry http://registry.cnpmjs.org 安装cnpm并设置国内源 npm install -g cnpm --registry=https://registry.npm.taobao.org 查看配置 npm config l
阅读全文
摘要:存在JQuery var imgsrc = new Array; $("li[class=blocks-gallery-item] img").each(function() { imgsrc.push($(this).attr("src")); }); 也可以试试引入JQuery 获取页面所有im
阅读全文
摘要:在nginx配置中添加 location / { try_files $uri $uri/ @router; index index.html; } location @router { rewrite ^.*$ /index.html last; }
阅读全文
摘要:修改Axios安装模块 /node_modules/axios/lib/core/settle.js 'use strict'; var createError = require('./createError'); /** * Resolve or reject a Promise based o
阅读全文
摘要:写好的直接用,可指定模块,引入在主页面即可 index.vue <template> <div> <Footer specify="如果需要指定页面填写路径即可"></Footer> </div> </template> <script> import Footer from '../compone
阅读全文
摘要:线性渐变 background: linear-gradient(0deg, rgba(255,0,0,0), rgba(255,0,0,1)); deg: 重复线性渐变 background: repeating-linear-gradient(45deg,yellow 10px, green 9
阅读全文