logo
publist
写文章

简介

该用户还未填写简介

擅长的技术栈

可提供的服务

暂无可提供的服务

vue路由跳转后回到视图顶部

app.vue:mounted() {this.$router.afterEach((to, from, next) => {window.scrollTo(0, 0)})},

使用vue-scroller滚动到指定位置(三级联动)

// this.$refs.screenType2.getPosition()— 获取当前scroller的位置;// this.$refs.screenType2.scrollTo(0, this.screenType2Position.top, true) 滚动到当前位置** 注意必须使用setTimeOut()//datascreenInfo: fa...

vue-router中keep-alive的使用以及注意情况

1. 使用+ 在app.vue中用keep-alive将router-view包裹起来<keep-alive><router-view v-if="$route.meta.keepAlive"></router-view></keep-alive><ro

vue区分线上环境和本地开发环境

config/dev.env.js'use strict'const merge = require('webpack-merge')const prodEnv = require('./prod.env')module.exports = merge(prodEnv, {NODE_ENV: '"development"',API_ROOT: '&quo

vue移动端touch事件

开始事件是 @touchstart;移动事件是 @touchmove;结束事件是 @touchend;

vue使用vconsole调试页面

安装cnpm i vconsolesrc/main.js引用import Vconsole from 'vconsole';const vConsole = new Vconsole();Vue.use(vConsole)ojbk

vue判断Android还是ios

appSource() {const u = navigator.userAgent;const isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);if (isiOS) {return "ios";} else {return "andriod";}},

vue通过ref改变input的type

template:<input type="text" ref="input"v-model="inputPad" @focus="zfocus" @blur="zblur">data:inputPad: "请输入支付密码",methods:zfocu

vue返回上一个路由

//返回上一层this.$router.go(-1);

vue使用better-scroll导航滚动的指定位置

思路:主要是通过better-scroll的scrollToElement()方法来实现的import BScroll from 'better-scroll';template:<div class="tab" ref="tab"><ul ref="tabWrapper" class=&quot

    共 16 条
  • 1
  • 2
  • 请选择