- 博客(17)
- 收藏
- 关注
原创 vue详情页返回列表页保留筛选条件及页码 并调取刷新列表
因keepAlive属性对应activated函数钩子 只需在此函数中调取列表接口即可。在列表页的路由meta属性中 添加 keepAlive:true。在App.vue中添加。
2023-05-19 15:47:29
846
原创 css加载图片就旋转
<div class="demo"> <img class="an img" src="/test/img/2.png" width="500" height="500"/></div>.demo{text-align: center; margin-top: 100px;}@-webkit-keyframes rotation{ from {-webkit-transform: rotate(0deg);} to {-webk.
2022-04-22 10:52:27
171
原创 css 实现图片反转特效
html中<div class="flip-container" ontouchstart="this.classList.toggle('hover');"> <div class="flipper"> <div class="front"> <!-- 前面内容 --> </div> <div class="back"> <!-- 背面内容 --> </div> </
2022-04-21 19:00:04
3114
原创 css实现隐藏滚动条
-ms-overflow-style: none; /* IE 10+ */ scrollbar-width: none; /* Firefox */写在盒子内 ::-webkit-scrollbar { display: none; /* Chrome Safari */ }单独写在样式中
2022-04-20 18:07:07
3261
原创 vue2.0移动端适配 rem布局
下载两个插件命令npm i lib-flexible -S 根据移动端屏幕大小而对应改变html的fontSizenpm i postcss-pxtorem@5.1.1 -D 根据html的fontSize将px单位改变为rem单位项目中创建postcss.config.js用来配置postcss-pxtorem插件注意是js文件文件中复制以下内容module.exports = { plugins: { "postcss-pxtorem": { ..
2022-04-19 17:05:40
856
原创 纯html移动端适配 引入rem.js
定义rem.js文件(function(doc, win) { var docEl = doc.documentElement, resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize', recalc = function() { var clientWidth = docEl.clientWidth; if (!cli
2022-04-19 16:49:52
504
原创 监听屏幕滑动
<script>window.οnscrοll=function(){ var t =document.documentElement.scrollTop||document.body.scrollTop; //变量t就是滚动条滚动时,到顶部的距离 var left =document.getElementById("left");if( t >=100) { //当拖动到距离顶部100px处时,左边导航固定,不随滚动条滚动 left.style..
2022-04-18 14:33:42
284
原创 css遮罩层样式
popContainer { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.3);}
2022-04-11 17:42:31
387
原创 小程序自定义标题栏
在当前页的onload中let menuButtonObject = wx.getMenuButtonBoundingClientRect(); wx.getSystemInfo({ success: res => { let statusBarHeight = res.statusBarHeight, navTop = menuButtonObject.top,//胶囊按钮与顶部的距离 navHeight =
2022-04-07 17:41:46
309
原创 实现前端跨域
proxyTable: { '/api': { target: 'https://shouquanma.laikan.xin', //后端域名 changeOrigin: true, pathRewrite: { '^/api': 'https://shouquanma.laikan.xin' //后端域名 } } },再config文件夹下index.js中引入...
2022-04-06 13:21:55
737
原创 使用file-saver和xlsx插件下载excel
安装命令npm install -S file-saver(生产依赖,则为-s)npm install -S xlsxnpm install -D script-loader (开发依赖,则为-d)安装完成后新建文件夹(static下)exportExcel在文件下载写入两个文件Blob.js和Export2Excel.jsBlob.js/* Blob.js * A Blob, File, FileReader & URL implementation. * 2018
2022-02-25 17:25:22
1101
原创 路由跳转编程式路由
push()往历史记录中添加一条记录this.$router.push('path地址')replace()往历史记录中替换一条记录this.$router.replace('path地址')go(n)n是数值 -1是上一页 1是下一页返回上一页this.$router.go(-1)back()返回this.$router.back()...
2022-02-10 18:00:16
1041
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人