随笔分类 - VUE
项目实战
摘要:<!-- 轮播banner图 --> <div class="banner"> <div class="swiper-container" id="swiper-banner"> <div class="swiper-wrapper"> <div class="swiper-slide" v-for
阅读全文
摘要:store.dispatch 可以处理被触发的action的处理函数返回的promise, return Promise.resolve(xxx) 并且 store.dispatch 中的方法返回的是一个Promise对象 this.$store.dispatch('').then(res => {
阅读全文
摘要:基于原生swiper.js的异型轮播 <div class="swiper-container" > <div class="swiper-wrapper"> <div v-for="(item, index) in currentSwipeInfo.fuCardList" :key="index"
阅读全文
摘要:scrollTop + clientHeight >= scrollHeight // 滚动到当前元素所在的位置 this.$refs.el.scrollIntoView()
阅读全文
摘要:mounted() { document.addEventListener('visibilityChange', 事件处理函数) }, destoryed() { document.removeEventListener('visibilityChange', 事件处理函数) }, methods
阅读全文
摘要:// actions import { queryProductDetailsById } from '../service' /* * 异步 */ export const addAndGetProduct = ({ commit, state, getters }, params) => { c
阅读全文
摘要:console.log('判断页面是否有滚动条', this.hasScrollbar) const that = this that.count = 0 // 计数 that.scrollProxy = new Proxy({ hasScrollToEnd: !that.hasScrollbar,
阅读全文
摘要:<div class="poster-qr"> <div class="qrWrapper"> <!-- 放置二维码的容器 --> <div id="qrcode" ref="qrcode" class="qrcode"/> </div> <div class="qrDesc">长按扫描二维码领取<
阅读全文
摘要:// 字符串 <router-link to="apple"> to apple</router-link> // 对象 <router-link :to="{path:'apple'}"> to apple</router-link> // 命名路由 <router-link :to="{name
阅读全文
摘要:// 全局组件和局部组件 Vue.component('组件名',配置对象) Vue.component('global', { template: ` <div> <h1>全局组件<h1> // 局部组件 <gl-demo></gl-demo> </div> `, data() { return
阅读全文
posted @ 2020-06-03 23:52
糖锡
摘要:// 常规的数组排序的方法 a-b升序 b-a降序 arr.sort(function(a,b) { return a - b }) // sort内部是有嵌套排序机制的 两级排序 this.productSourceList = productSourceList.sort(this.sortBy
阅读全文
摘要:<template> <div class="mainBody"> <!-- <div v-if="isLoading" class="loading">loading</div> --> <div v-if="isLoading" class="mask"> <loading size="24px
阅读全文
摘要:<div ref="tab" class="tab"> <ul ref="tabWrapper" class="tab_content"> <li v-for="item in prodfoldPostList" ref="tabitem" :key="item.id" class="tab_ite
阅读全文
浙公网安备 33010602011771号