可以获取到当前网页宽度和当前网页高度
mounted() {
window.addEventListener('resize', this.getHeight)
},
methods: {
getHeight(e) {
con...
yekong
3年前 (2021-12-03)
喜欢
vue项目开发时可能会使用iframe引入页面,留个实例,方便后期用到的时候回查
<template>
<div>
<iframe class="iframe" id="template-iframe&quo...
yekong
3年前 (2021-12-02)
喜欢
vue项目开发中,经常需要一些列表滚动效果,之前一直使用的是liMarquee,一个滚动的时候,效果还可以,多个滚动的时候总感觉有点不对,就换了一个插件
安装依赖
npm i vue-seamless-scroll --save
使用
<vue-seamless...
yekong
3年前 (2021-11-30)
喜欢
vue项目开发中,会遇到切换页面时,上一个页面的接口还在请求,当只有一两个页面的时候,无所谓,但是当页面有几十个接口的话,就有必要切换页面是,结束上一页未完成的无效请求,以节省接口资源。
切换页面时,由于上一页面请求执行时间长,切换到该页面时,还未执行完,这时那个请求仍会继续执行...
yekong
3年前 (2021-11-29)
喜欢
第一种
methods:{
back(){
this.$router.go(-1);//返回上一层
},
},
第二种
@click="$router.back(-1)"
...
yekong
3年前 (2021-11-27)
喜欢
<div class="profiledetail scroll">
<el-backtop target='.profiledetail'></el-backtop>
<headtop...
yekong
3年前 (2021-11-27)
喜欢
在路由文件中增加
router.afterEach(() => {
document.body.scrollTop = 0
document.documentElement.scrollTop = 0
})
...
yekong
3年前 (2021-11-23)
喜欢
<template>
<div class="slide">
<a-carousel autoplay arrows dots-class="slick-dots slick-thumb">...
yekong
3年前 (2021-11-23)
喜欢
vue
<el-input
v-model="scope.row.discount"
type="number"
@inpu...
yekong
3年前 (2021-11-20)
喜欢
依赖文件
function get_object_first_attribute(data) {
for (var key in data)
return data[key];
}
function myCache(key, value, seconds...
yekong
3年前 (2021-11-20)
喜欢