- 博客(12)
- 收藏
- 关注
原创 vue锚点导航
//在box中 <div :id="gernerateId(index)" class="scrooltop" :class="{topone:flagindex==index}" v-for="(val,index) in data" :key="index">gernerateId(index) { return "box" + index
2019-02-28 16:27:37 1458
翻译 vue 父子组件通信
//子组件<template> <div> <button>+</button> <p><span>{{num}}</span></p> </div></template>&a
2019-02-22 14:30:50 124
原创 vue axios 拦截器
在main.js中插入axiosimport axios from 'axios'axios.defaults.headers.common['token'] = store.state.token;// 添加请求拦截器axios.interceptors.request.use(config => { // 在发送请求之前做些什么 //判断是否存在token,...
2019-02-15 14:39:10 202
原创 vue 放大镜
<template> <div class="magnifier-box" :class="vertical?'vertical':''" :ref="id" @mousemove="mousemove" @mouseover="mouseover" @mouseleave="mouseleave"> &am
2019-01-07 18:09:54 1390
原创 filter函数和map函数的用法
1.数组取重var arr = [1, 2, 2, 3, 4, 5, 5, 6, 7, 7,8,8,0,8,6,3,4,56,2]; var arr2 = arr.filter((x, index,self)=>self.indexOf(x)===index) console.log(arr2); //[1, 2, 3, 4, 5, 6, 7, 8, 0, 56]---------...
2018-11-26 15:19:30 370
原创 vue 记录原页面的scrollTop
在原页面中beforeRouteLeave(to, from, next) {let position = window.scrollY //记录离开页面的位置if (position == null) position = 0store.commit('changeRecruitScrollY', position) //离开路由时把位置存起来next()},在sto...
2018-08-31 11:21:33 1212
原创 vue 回退 不刷新 缓存问题 从A页跳到B页,缓存A页,当B再次返回A时,页面不刷新
//在index.js中 { path: '/SearchContent', name: 'SearchContent', component: SearchContent, meta: { keepAlive: false,//此组件不需要被缓存 isBack:fal...
2018-08-09 18:25:26 6820
原创 el-table里面hover,click图片 右侧放大
<el-table-column prop="imagePath" header-align="center" align="center" width="150px" label="图片"> <template slot-scope="scope"> <el-popover pl
2018-08-09 15:25:33 1019
原创 VUE+element-ui 开发的项目 IE浏览器打开显示空白问题
因为IE浏览器版本的问题,IE浏览器不支持ES6,所以就出现了promise未定义的问题需要下载babel-polyfill 在main.js中引用 babel-polyfill1 npm install --save babel-polyfill2 import 'babel-polyfill'...
2018-08-09 11:05:44 8749
翻译 仿淘宝放大镜效果
<!DOCTYPE html><html><head><meta charset="UTF-8"><title>放大镜效果</title><style type="text/css">* {margin: 0;padding: 0;}#small {w
2018-08-07 10:43:21 227
原创 点击浏览器返回不是想要的页面
var host = window.location.hostwindow.open("http://localhost:8080/#/detail?productID="+ id)
2018-08-07 10:30:36 304
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人