vue
大师兄 总结 关于 vue的 笔记
卫东哥哥~~
web前端开发工程师,
英文名Tiga
中式8球业余选手(百步穿杨),
好人卡获得者,
情歌王子!
展开
-
webstorm 链接服务器+更新前端代码
前端代码打包 更新服务器原创 2022-09-28 11:16:28 · 985 阅读 · 1 评论 -
保留指定小数点位数
element input 输入框 保留指定小数点位数原创 2022-06-27 10:59:33 · 396 阅读 · 0 评论 -
mac 本地nginx运行 vue3 项目
一、 安装nginx 环境1.安装 brew (复制下面代码) /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"2.安装 nginxbrew install nginx3.启动nginxsudo nginx访问localhost:8080 可以正常访问代表启动成功3.关闭nginxsudo nginx -s stop4..原创 2022-04-15 11:51:12 · 3997 阅读 · 0 评论 -
uni-app h5 复制功能(设置剪贴板)
/**设置系统剪贴板的内容@param {string} data 需要设置的内容@returns {Promise} 设置的内容*/export function setClipboardData(data) {return new Promise((success, fail) => {// #ifndef H5uni.setClipboardData({ data, success, fail })// #endif// #ifdef H5const texta原创 2021-04-29 16:50:11 · 727 阅读 · 0 评论 -
vue 二进制文件的下载
blobdownFilebinary(ajaxUrl,name,methodType){deleteaxios.defaults.headers['api-version']axios({method:methodType,url:ajaxUrl,responseType:'blob'}).then(res=>{letblob=newBlob([...原创 2020-08-22 20:10:49 · 618 阅读 · 0 评论 -
ie 浏览器 get请求 数据 不更新
http.interceptors.request.use(function(config){//解决ie数据获取不同步的问题if(config.method==='get'){if(config.params){config.params['ieT']=newDate().getTime()}else{config.params={ieT:newDate().getTime()...原创 2020-08-19 17:36:05 · 338 阅读 · 0 评论 -
vue antd 按需加载 报错.bezierEasingMixin()
1. 修改 less 版本 为3.0 一下 yarn add less@^2.7.32.在vue.config.js中添加less-loader:5.0.xmodule.exports = { css: { loaderOptions: { less: { javascriptEnabled: true, }, }, },};les...原创 2020-08-06 16:36:19 · 1735 阅读 · 0 评论 -
前端常用60余种工具方法(建议收藏)
作者:vipbichttps://segmentfault.com/a/11900000227368371.邮箱export const isEmail = (s) => { return /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(s)}2.手机号码export const isMobile = (s) => { return /^1[0-9]{10.转载 2020-07-21 14:05:50 · 351 阅读 · 0 评论 -
判断 是否是pc
js中判断 当前是在手机端 还是 pc端 手机端打pc端网站 跳到手机网站 pc端打手机端网站 跳到pc网站functionIsPC(){varuserAgentInfo=navigator.userAgent;varAgents=["Android","iPhone","SymbianOS","WindowsPhone","iPad","iPod"];varflag=true;...原创 2020-07-15 17:11:21 · 390 阅读 · 0 评论 -
Vue 中 app 监听安卓 物理返回
// 监听安卓 返回键在main.js中//监听安卓返回键(function() { function plusReady() { let quit = false; plus.key.addEventListener('backbutton', function() { let path = vue.$route.path; if (path === '/login') { ...原创 2020-07-15 10:28:54 · 414 阅读 · 0 评论 -
uni-app 升级配置
<script> import { appUpApi } from './api/index.js'; onLaunch: function() { // #ifdef APP-PLUS // 监听 升级配置 appUpApi().then(res => { if (res.data && res.data != '') {...原创 2020-07-15 10:08:36 · 481 阅读 · 2 评论 -
canvas 绘制 分享图片 加 保存图片在系统相册
// 效果图代码<template> <view class="page-class bg-page">// 利用canvas 最终 生成图片 <canvas class="poster-wrapper" canvas-id="shareCanvas"></canvas> <view class="footer-info"> <view class="sh...原创 2020-07-13 18:14:32 · 413 阅读 · 1 评论 -
正则限制input输入小数点后保留两位小数
<div><input type="text" v-model="newPrice" /></div>export default {data() { return { newPrice: "", timer: null };},watch: { newPrice(val){ clearTimeout(this.timer); //防抖 this.timer = setTimeout(() =>.原创 2020-07-13 10:13:28 · 1856 阅读 · 0 评论 -
自定义指令
minheight.js--------------------------------------------functionresizeHandle(el){constheight=document.documentElement.clientHeightletheader=document.getElementsByClassName('main-header')[0]letfooter=document.getElementsByClassName...原创 2020-07-08 19:20:27 · 160 阅读 · 0 评论 -
vuex 状态 缓存
1、代码 保存在 app 页面编写export default function(ctx){ // 离开页面 window.addEventListener('beforeunload', ()=> { console.log('触发离开事件') sessionStorage.setItem("store",JSON.stringify(ctx.store.state)) });// 页面...原创 2020-07-03 16:52:37 · 557 阅读 · 0 评论 -
vue中获取 某个元素 距离 顶部的距离
this.$refs.pageScroll1.offsetTop原创 2020-07-02 13:54:41 · 6664 阅读 · 0 评论 -
图片预览 插件
# 安装npm install vue-photo-preview --save# 引入import preview from 'vue-photo-preview'import 'vue-photo-preview/dist/skin.css'Vue.use(preview)//或者 //var option={....} option配置请查看 http://photoswipe.com/documentation/options.html//Vue.use(preview,opt.原创 2020-06-16 21:18:22 · 208 阅读 · 0 评论 -
api axios 封装
react/vue前提 安卓 axiosyarn add axiosreact 设置代理 先安装下,install http-proxy-middleware新建 setupProxy.jssetupProxy.js-------------------------------------------------constproxy=require('ht...原创 2020-01-07 15:45:03 · 152 阅读 · 0 评论 -
css 箭头图标展示
div:after{ content:'';border-top:9px solid #eaeaea;border-left: 12px solid transparent;border-right: 12px solid transparent;}原创 2019-12-30 14:40:24 · 264 阅读 · 0 评论 -
解决微信返回上一页之后,页面不刷新
问题描述: A页面跳转到B页面,在B页面进行了相关的操作之后,返回到A页面,A页面的数据没有刷新.具体实例:由于项目中使用了vue,使用了gulp和普通的页面跳转。并没有引入vue-router。所以不能使用 watch监控$router。微信公众号ios点击后退按钮,优选读取缓存,所以vue里的生命周期不会在进行调用。所以项目中执行隐藏分享qq,空间。等功能不被再次执行。原因分析:一...原创 2019-12-26 19:55:37 · 3045 阅读 · 0 评论 -
vue axios配置
importaxiosfrom'axios'axios.defaults.headers={'api-version':'V1'}axios.defaults.baseURL='/XZAPI'axios.interceptors.request.use(function(config){returnconfig;},funct...原创 2019-11-26 18:07:19 · 154 阅读 · 0 评论 -
vue-cli(3.0) 打包 配置服务端 (nginx)
一、 打包 vue.config.jsmodule.exports={publicPath:'/cli3/', // 打包 线上路径css:{loaderOptions:{postcss:{plugins:[require('postcss-px2rem')({...原创 2019-11-26 17:15:12 · 782 阅读 · 0 评论