笔记
hh22。
这个作者很懒,什么都没留下…
展开
-
vue使用three.js实现粒子波浪效果
vue使用three.js实现粒子波浪效果原创 2023-03-01 10:02:30 · 909 阅读 · 0 评论 -
vue在线预览word文件
vue在线预览doc文件原创 2023-02-09 09:44:49 · 909 阅读 · 1 评论 -
vue中获取用户IP地址
【代码】vue中获取用户IP地址。原创 2022-12-16 17:18:47 · 1788 阅读 · 1 评论 -
vue中使用echarts的chain.js生成地图散点图以及性能优化
使用地图时因为返回的数据点太多,造成页面加载过慢,卡顿等影响,优化过后,性能提升。1、创建map.vue组件<template> <div class="map"> <h3> <span class="icon-cube"></span> 活跃运营中心数据统计 </h3> <div class="geo" id="geo"></div> </div原创 2021-11-26 17:23:14 · 1682 阅读 · 1 评论 -
js模拟键盘事件
// 模拟浏览器键盘事件function keyEvent(key) { var e = $.Event('keydown'); e.keyCode = key; e.which = key; $(window).trigger(e); if(key == 13) { console.log('按下回车键') }}keyEvent(13)原创 2021-11-13 10:49:44 · 3476 阅读 · 0 评论 -
vue中禁用右键,禁止选中
原创 2021-11-12 15:45:23 · 1181 阅读 · 0 评论 -
vue数字滚动效果
1、安装vue-count-tonpm install vue-count-to --save2、引入注册import countTo from 'vue-count-to' components: { countTo },3、使用<template> <div> <countTo :startVal="startVal" :endVal="endVal" :duration="2000"></countTo> &原创 2021-07-01 17:31:50 · 128 阅读 · 0 评论 -
本地电脑localhost指向127.0.0.1的配置
1、参考2、更改ip指向,项目域名,保存3、浏览器重新打开原创 2021-06-24 11:43:11 · 2985 阅读 · 0 评论 -
vue中实现h5分享截图
1、html2canvas官方文档原创 2021-06-21 16:04:14 · 527 阅读 · 0 评论 -
ios中时间格式不兼容问题
1、vant组件中CountDown 倒计时组件 ios不生效2、时间格式不兼容原因: 是因为ios解析时间方式和其他不一样,需要把 - 转化为 / 然后才能转时间戳 原因是yyy-mm-dd hh:mm:ss 格式ios不识别 把yyy-mm-dd hh:mm:ss 格式转换成 yyy/mm/dd hh:mm:ss解决方法: var timeStr = '2019-08-15' var time = time.replace(/-/g, '/') console.log(ti原创 2021-06-18 10:54:39 · 931 阅读 · 0 评论 -
获取某个时间点的时间戳
new Date(‘2020-3-14 11:30:00’).getTime()指定时间自动隐藏弹窗if (new Date().getTime() > new Date("2021-6-1 20:00:00").getTime()) { this.show = false;}原创 2021-05-26 17:52:35 · 725 阅读 · 0 评论 -
vue引入scss文件或者less文件,报错 this.getOptions is not a function
原因是sass-loader版本过高1、npm uninstall sass-loader(卸载当前版本)2、npm install sass-loader@7.3.1 --save-dev原创 2021-04-12 13:26:47 · 447 阅读 · 0 评论 -
uniapp中动态设置clac
:style="{ maxHeight: 'calc(100vh - ' +headerTop + 'px - 49px)'}"原创 2021-03-03 15:30:35 · 440 阅读 · 1 评论 -
uniapp打包安卓app自动更新(整包更新)
// 写在onload中 防止不停地提示 onLoad() { // 添加条件编译 只在APP中执行改代码,防止报错 // #ifdef APP-PLUS uni.getSystemInfo({ success: (res) => { var _this = this; //检测当前平台,如果是安卓则启动安卓更新 if (res.platform == "android") { ...原创 2021-01-08 17:31:28 · 2706 阅读 · 0 评论 -
vue中关闭浏览器清除localStorage
1.在app.vue中关闭浏览器清除信息,并且刷新时保持状态不受影响 mounted() { window.onload = function () { console.log(window.sessionStorage["ISlogin"]); if (!window.sessionStorage["ISlogin"]) { // 关闭浏览器 window.localStorage.removeItem("userInfo");原创 2020-11-30 17:11:14 · 3614 阅读 · 2 评论 -
vue中使用alipalyer(2)
新加 1. 右侧目录默认选中功能2. 自动播放下一集 并记录时间,设置播放时间<template> <div> <div @contextmenu.prevent class="w"> <div class="video_page"> <div class="vedio_top"> <div class="vedio_tit"> <img原创 2020-11-30 16:18:45 · 942 阅读 · 0 评论 -
uniapp根据链接生成二维码
兼容小程序和h5、app参考地址原创 2020-11-25 10:51:19 · 1080 阅读 · 0 评论 -
vue中实现图形验证
1. 封装一个组件<template> <div class="s-canvas"> <canvas id="s-canvas" :width="contentWidth" :height="contentHeight" ></canvas> </div></template><script>export default { name: "SIdenti原创 2020-11-18 15:42:02 · 557 阅读 · 0 评论 -
vue中生成二维码
参考地址1、安装npm i vue-qriously -S2、在main.js中// 生成二维码import VueQriously from 'vue-qriously'Vue.use(VueQriously)3、页面中使用 <qriously :value="url" :size="120" /> data() { return { url:'http:..........' } }...原创 2020-11-14 18:18:21 · 276 阅读 · 0 评论 -
vue中动态修改meta头部标签
参考地址使用案例app.vue页面中<template> <div id="app"> <!-- <div id="nav"> <router-link to="/">Home</router-link> | </div> --> <router-view /> </div></template><script>imp原创 2020-11-13 18:59:29 · 2318 阅读 · 0 评论 -
阿里播放器的使用Aliplayer
阿里在线配置<template> <div> <div @contextmenu.prevent class="w"> <div class="video_page"> <div class="vedio_top"> <div class="vedio_tit"> <img @click="goBack"原创 2020-11-12 18:48:09 · 1159 阅读 · 1 评论 -
vue使用echarts挂载数据
<style lang="less" scoped>.class_tabs { border-bottom: 1px solid #dddddd; .tabsList { width: 120px; text-align: center; font-size: 16px; color: #0c69e6; height: 64px; line-height: 60px; padding: 0 20px; box-sizing原创 2020-11-11 18:26:16 · 746 阅读 · 0 评论 -
vue中实现点击复制功能
<div class="lianjie_box"> <div class="dizhi">{{ url }}</div> <div class="dizhi_btn" @click="copyUrl" :data-clipboard-text="url" > <img src="../../assets/img/personal/icon_lian..原创 2020-11-06 15:49:56 · 1782 阅读 · 0 评论 -
vue中一键返回顶部功能
<div @click=" goTop">返回顶部</div> mounted() { window.addEventListener("scroll", this.handleScroll); }, destroyed() { document.removeEventListener("scroll", this.handleScroll); }, methods: { handleScroll() { const that原创 2020-11-03 16:51:38 · 863 阅读 · 4 评论 -
vue中全局配置页面切换自动回到顶部
1.在main.js或者router.js添加代码Router.afterEach((to, from, next) => { window.scrollTo(0, 0); // 或 // window.scroll(0, 0);});原创 2020-11-03 16:39:57 · 463 阅读 · 0 评论 -
vue打包之后在本地预览报错Failed to load resource: net::ERR_FILE_NOT_FOUND
1、创建vue.config.js文件module.exports = { // 选项... publicPath: "./", //打包时加上 // devServer: { // https: false, // proxy: { // '/api': { // target: 'http://120.78.95.239', // changOrigin: true, // pathRewrite: { //原创 2020-10-26 10:01:39 · 873 阅读 · 0 评论 -
uniapp云打包生成证书并打包
1、参考资料 :https://blog.csdn.net/weixin_42036591/article/details/88752679?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_param&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachin原创 2020-10-10 15:03:18 · 1543 阅读 · 0 评论 -
vue中实现上传功能
<div class="tx_box"> <img v-if="imageUrl" :src="imageUrl" alt="" /> <img v-else src="../../assets/img/home/img8.png" alt="" /> <div @click.stop="uploadHeadImg">修改头像</div> <input type="fi.原创 2020-09-28 18:48:48 · 278 阅读 · 0 评论 -
小程序请求封装(二)
1.在main.js 里写import http from './static/js/api/request.js'import qs from "qs"Vue.prototype.$http = http2.创建request.ks页面import qs from "qs"const baseUrl = 'https://*****.com';const httpRequest = (url, method = "get", data) => { let token = un原创 2020-09-15 12:04:02 · 108 阅读 · 0 评论 -
小程序请求封装request(一)
1. 创建request.jsimport qs from "qs"const baseUrl = 'http://xlw.fukaowang.com';const request = (url, data) => { let token = uni.getStorageSync('token') // console.log(token) return new Promise(function(resolve, reject) { uni.showLoading({ titl原创 2020-09-15 11:57:02 · 162 阅读 · 0 评论 -
vue中实现锚点定位以及平滑滚动到指定位置。
// 点击此处 <div @click="goDingyue">立即订阅</div> // 跳转到该位置 <div class="dingyue_box" ref="dingyue_box_ref"> 立即订阅内容 </div> methods: { goDingyue() { // 获取元素在页面中的位置 console.log(this.$refs.dingyue_box_ref.getB原创 2020-09-02 16:32:43 · 2717 阅读 · 0 评论 -
vue中实现滚动头部导航背景变色
<template> <div class="header" :style="style" :class="{ color: color }"> 这是头部 </div></template><script>export default { data() { return { style: { backgroundColor: "", }, color: false原创 2020-09-02 11:41:04 · 2250 阅读 · 0 评论 -
关于eslint.
vue cli 中取消eslint1. 在项目根目录下增加vue.config.js文件。module.exports = { lintOnSave: false}原创 2020-08-29 16:53:28 · 72 阅读 · 0 评论 -
修改浏览器滚动条样式
div::-webkit-scrollbar{ width:12px; height:12px;}div::-webkit-scrollbar-track{ background: rgb(239, 239, 239); border-radius:2px;}div::-webkit-scrollbar-thumb{ background: #bfbfbf; border-radius:10px;}div::-webkit-scrollbar-thumb:hover{原创 2020-08-25 16:18:39 · 291 阅读 · 0 评论 -
vue中实现复制功能
var oInput = document.createElement(‘input’);//创建隐形inputoInput.value = url; url要复制的内容document.body.appendChild(oInput);oInput.select();document.execCommand(“Copy”);oInput.remove();layer.alert(‘复制成功,快去分享好友一起学习’);...原创 2020-08-24 16:43:58 · 955 阅读 · 0 评论 -
处理金额的千分位符
代办总额 {{toThousands(totalRes)}} 元methods: {// 处理金额的千分位符toThousands(num) {var num = (num || 0).toString(),result = ‘’;while (num.length > 3) {result = ‘,’ + num.slice(-3) + result;num = num.slice(0, num.length - 3);}if (num) {result = num ..原创 2020-05-25 18:07:29 · 375 阅读 · 0 评论 -
vue中切换背景颜色。
beforeCreate: function() { if (document.getElementsByClassName("page")[0]) document.getElementsByClassName("page")[0].className = "page1"; }, beforeDestroy: function() { document.get...原创 2020-01-07 18:49:22 · 2103 阅读 · 0 评论