12 2020 档案
摘要:store.dispatch 可以处理被触发的action的处理函数返回的promise, return Promise.resolve(xxx) 并且 store.dispatch 中的方法返回的是一个Promise对象 this.$store.dispatch('').then(res => {
阅读全文
摘要:// 将日期转换成时间戳 new Date().getTime() Date.now() // 将数字转换成日期格式 new Date().setTime(Number类型的数字) // 时间格式转换 ios无法识别'-' 需替换成/ res.data.time.replace(/\-/g, '/'
阅读全文
摘要:基于原生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()
阅读全文
摘要:// 单行省略 overflow: hidden; text-overflow: ellipise; white-space: no-wrap; // 两行省略 overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -web
阅读全文
摘要:mounted() { document.addEventListener('visibilityChange', 事件处理函数) }, destoryed() { document.removeEventListener('visibilityChange', 事件处理函数) }, methods
阅读全文
摘要:// actions import { queryProductDetailsById } from '../service' /* * 异步 */ export const addAndGetProduct = ({ commit, state, getters }, params) => { c
阅读全文
摘要:<template> <div class="about"> <h3>flex相关的属性</h3> <div class="parent"> <div class="son1"></div> <div class="son2"></div> <div class="son3"></div> <div
阅读全文
摘要:console.log('判断页面是否有滚动条', this.hasScrollbar) const that = this that.count = 0 // 计数 that.scrollProxy = new Proxy({ hasScrollToEnd: !that.hasScrollbar,
阅读全文