- 博客(60)
- 收藏
- 关注
原创 git下载项目
1、初始化git init2、与origin master建立连接git remote add origin git@github.com:XXXX/nothing2.git3、把远程分支拉到本地git fetch origin dev(dev为远程仓库的分支名)4、在本地创建分支dev并切换到该分支git checkout -b dev(本地分支名称) origin/dev(远程分支名称)5、把某个分支上的内容都拉取到本地git pull origin dev(远程分支名称)...
2022-02-25 11:57:15
349
原创 新增和编辑的写法
confirm() { this.$refs["form"].validate(valid => { if (valid) { if (this.detail) { // 判断是否有修改 有则传 let data = { id: this.detail }; const form = this.editForm; let isEdit = false; .
2021-05-21 14:50:50
210
原创 分页组件
分页子组件<template> <div class="pagination_content"> <div class="total" > 共 {{total}} 项 </div> <div class="pagination flex"> <div class="relative"> 每页显示 <Dropdown trigger="click"&
2021-05-11 10:42:37
723
原创 时间月份 和时间跨度限制
/* * @Author: your name * @Date: 2021-04-13 10:46:49 * @LastEditTime: 2021-04-15 13:56:47 * @LastEditors: Please set LastEditors * @Description: In User Settings Edit * @FilePath: \Smart-Park-web\src\utils\time.js */import vueI18n from './i18n'imp
2021-04-29 18:06:18
396
原创 localStorage组件
// * 存储localStorageexport const setStore = (name, content) => { if (!name) return; if (typeof content !== 'string') { content = JSON.stringify(content); } window.localStorage.setItem(name, content);}/** * 获取localStorage */export const getS
2021-04-29 17:47:42
136
原创 移动端登录打印时判断类型
// 移动端登录打印时判断类型export const isMobile = () => { let flag=navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i); return flag}expo
2021-04-29 17:45:14
102
原创 公共组件
// 公共方法封装import { baseUrl } from '../config/config'import vueI18n from './i18n'import { getStore, setStore, removeStore } from './storage';// 时间偏移量const zone = new Date().getTimezoneOffset() / 60 * 3600 * 1000 * 2;//为字符串插入字符 其中soure为原字符串,start为将要插入字符
2021-04-29 17:44:34
233
原创 cookie组件
//设置cookie,增加到vue实例方便全局调用 export const setCookie=(c_name, value, expiredays) => { var exdate = new Date(); exdate.setDate(exdate.getDate() + expiredays); document.cookie = c_name + "=" + escape(value) + ((expiredays == null) ? "" : ";expires=" +
2021-04-29 17:39:16
162
原创 i8n的使用
1、安装 vue-i18n依赖包;使用NPM进行安装或者CNPM进行安装。npm install vue-i18n --save-dev2、此处以vue项目举例,将i18n引入vue实例,首在在main.js中引入 vue-i18n。对i18n进行封装i18n.js/* 多语言切换*/import Vue from 'vue'import { i18n } from 'view-design'import VueI18n from 'vue-i18n'import messages,
2021-04-29 14:14:20
1798
原创 2021-04-09
this.laneEntryList = res.data.filter(item=>{ return item.pathType == 0 });*有普配相同的全部在 this.laneEntryList里 *
2021-04-09 14:31:46
95
原创 JS数组操作常用方法
JS数组操作常用方法toString():把数组转换成一个字符串toLocaleString():把数组转换成一个字符串join():把数组转换成一个用符号连接的字符串shift():将数组头部的一个元素移出unshift():在数组的头部插入一个元素pop():从数组尾部删除一个元素push():把一个元素添加到数组的尾部concat():给数组添加元素slice():返回数组的部分reverse():将数组反向排序sort():对数组进行排序操作splice():插入、删除或者替
2021-01-16 14:55:37
164
1
原创 vuex状态 显示和隐藏封装
状态管理显示和隐藏const commonFn={ // 显示和隐藏 // dispatch:含有异步操作,例如向后台提交数据,写法: this.$store.dispatch('action方法名',值) // commit:同步操作,写法:this.$store.commit('mutations方法名',值) closeClobalLoading(){ setTimeout(()=>{ store.dispatch('
2021-01-15 17:30:15
404
原创 封装 message消息弹框
信息弹窗封装import Vue from 'vue'import {Message} from 'element-ui'import bus from '../js/bus'Vue.prototype.$message=Messageconst commonFn={ // message弹出信息提醒 toastMsg(type,msg){ switch(type){ case 'normal': bus..
2021-01-15 15:54:38
523
原创 返回上一页封装
返回上一页组件// 点击返回上一页import router from '../../router/index'const formMixin={ methods:{ goback(){ router.go(-1) } }}export default formMixin引入
2021-01-15 10:38:01
154
原创 video-player组件使用
1安装npm install vue-video-player --savemain.js引入import VideoPlayer from 'vue-video-player'require('video.js/dist/video-js.css')require('vue-video-player/src/custom-theme.css')Vue.use(VideoPlayer)组件使用<template> <div class="video">
2020-12-21 21:11:42
5025
原创 input区间设置
键盘输入弹窗<!-- <input oninput="if(value > 54 || value < 1 ){alert('非法输入!');value=''}" type="number"> -->优化 点出input框外在做改变<!-- <input onchange="if(value > 54 || value < 21 ){alert('非法输入!');value=''}" type="number"> -->
2020-12-18 11:46:26
644
原创 vue2.0跨域
设置反向代理config -> index.js -> 文件设置反向代理 dev: { // Paths assetsSubDirectory: 'static', assetsPublicPath:'/', proxyTable: { '/api': { target: 'https://studioapi.bangniyin08.com', // 需要跨域请求的地址或者IP changeOrigin: tru
2020-12-15 21:09:30
188
原创 请求封住
request.js页面import axios from 'axios';import Vue from '../main.js';require("babel-polyfill");import { url } from './url';import md5 from 'js-md5';import router from '../router';// import store from '@/store';var request = axios.create({ timeout
2020-07-24 14:35:13
168
原创 整体页面放大镜
整体页面放大镜<template> <div> //这里是原始页面 你项目的页面全部在这里 </div> //下面就是对放大镜进行操作 <div id="b" style="width:150px;height:150px;top:0;left:0;position: relative;z-index:9999;overflow: hidden;"> <div id="c" style="transform: scale(1.5);
2020-07-17 16:34:14
248
原创 文字放大镜
组件 文字 放大镜组件<template> <!-- @mouseout="box=false" --> <span class="box" @mousemove="box = true" @mouseout="box=false"> <p class="p" @mousedown="asd($event)"> <span @mousemove="as(i,index)" v-for="(i,
2020-07-16 17:12:09
1107
原创 下载功能
exportExcel_lis() { // 设置当前日期 let time = new Date(); let year = time.getFullYear(); let month = time.getMonth() + 1; let day = time.getDate(); let name = year + "" + month + "" + day; /* generate workbook object .
2020-06-30 10:19:04
895
原创 解决vue 按钮多次点击重复提交问题
<Button type="primary" @click="bookok" :disabled="isDisable">确定</Button><script> export default { return { isDisable: false,//表单重复提交 }, methods: { bookok() { this.isDis.
2020-05-25 14:34:59
523
原创 打印功能
打印功能 preview(obj) { var headStr = "<html><head><title></title></head><body>"; var footStr = "</body>"; var newStr = obj.outerHTML; var newWindow = window.open("", "_blank", "k"); new
2020-05-14 16:06:47
262
原创 数据插入
在数据里面插入’全部’ this.itemList = data; console.log(data); var all = { create_time: "", id: "", item_type_name: "全部", status: "" }; this.itemList.unshift(all);
2020-05-12 14:58:28
142
原创 数据的截取 和等比分成
数据的截取 和等比分成 this.Dept_top = res.data; var num = Math.ceil(this.Dept_top.length / 3); this.p_ming = this.Dept_top.slice(0, num); this.p_ming_all = this.p_ming.length; ...
2020-04-21 13:56:13
251
原创 Echart饼型和柱形
html内容在methods里 drawLine(){ let myChart = this.$echarts.init(document.getElementById('myChart')) myChart.setOption({ title : { text: '某站点用户访问来源',//主标题 ...
2020-04-14 11:36:17
133
原创 element table表格导出
## html <span @click="exportExcel">class=table <el-table :data="rightsDate" max-height="450" class="table" >import XLSX from "xlsx";...
2020-01-16 10:37:26
362
原创 时间撮转化
后端反过来的时间如12314转化为2019-10-2this.historyv.forEach(function(val, idx, arr) { var times= val.dateline console.log(times) var d = new Date(times* 1000);//转换成普通日期格式 ...
2019-12-11 13:43:49
133
原创 vue 打包之后生成一个配置文件修改接口域名
第一步:在 static 静态文件中新建一个 config.js 文件,js 代码如下:window.global_config = { BASE_URL: "http://192.168.0.137:90"};第二步:在 index.html 中引入 static 文件夹下的 config.js 文件<script src="./static/config/index.js"&...
2019-12-05 12:04:16
753
原创 图片上传多张
<el-upload class="upload-demo" ref="upload" action="http://192.168.0.121:8004/admin/Upload/index" :multiple='true' ...
2019-12-05 11:25:57
168
原创 vue循环渲染不同样式
html<div id="wrap" class="box"> <div v-for="(list,index) in navLists" class="nav" :class="{ red:changeRed == index}" @click="reds(index)">{{list.text}}</div></div>css*...
2019-11-25 17:41:50
624
原创 多选选中多个参数
多选 <el-checkbox-group @change="selectContract" v-model="form.user"> <el-checkbox class="authorv" v-for="item in optionNext" :key="ite...
2019-11-24 11:46:54
419
原创 时间转化格式
时间转化格式 var d = new Date('Mon Nov 11 2019 15:59:43 GMT+0800 (中国标准时间)'); var resDate = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate() + ' ' + d.getHours() + ':' + d.getMin...
2019-11-12 11:04:54
373
1
原创 循环for数据点击一个push一次 里面有的覆盖 没有的添加进去
在return定义cc=[] vv(){ let c = {} // 这个数组是每次点击都需要初始化为空的 let zjy = [] // 模拟的数据 var random = new Array(0,1,2,3,4,5,6,7,8,9); this.code = Math.floor(Math.r...
2019-11-07 10:05:39
1255
原创 监听事件
监听内容 <editor id='tinymce' v-model='tinymceHtml' :init='init' ></editor> watch: { tinymceHtml(newValue, oldValue) { console.log('新输入的值为:'+newValue); // 会输出新值 consol...
2019-11-05 14:14:32
1143
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人