12 2020 档案

摘要:store.dispatch 可以处理被触发的action的处理函数返回的promise, return Promise.resolve(xxx) 并且 store.dispatch 中的方法返回的是一个Promise对象 this.$store.dispatch('').then(res => { 阅读全文
posted @ 2020-12-17 14:39 糖锡 阅读(74) 评论(0) 推荐(0)
摘要:// 将日期转换成时间戳 new Date().getTime() Date.now() // 将数字转换成日期格式 new Date().setTime(Number类型的数字) // 时间格式转换 ios无法识别'-' 需替换成/ res.data.time.replace(/\-/g, '/' 阅读全文
posted @ 2020-12-17 14:27 糖锡 阅读(135) 评论(0) 推荐(0)
摘要:基于原生swiper.js的异型轮播 <div class="swiper-container" > <div class="swiper-wrapper"> <div v-for="(item, index) in currentSwipeInfo.fuCardList" :key="index" 阅读全文
posted @ 2020-12-11 11:32 糖锡 阅读(1644) 评论(0) 推荐(0)
摘要:scrollTop + clientHeight >= scrollHeight // 滚动到当前元素所在的位置 this.$refs.el.scrollIntoView() 阅读全文
posted @ 2020-12-11 10:25 糖锡 阅读(725) 评论(0) 推荐(0)
摘要:// 单行省略 overflow: hidden; text-overflow: ellipise; white-space: no-wrap; // 两行省略 overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -web 阅读全文
posted @ 2020-12-10 17:33 糖锡 阅读(762) 评论(0) 推荐(0)
摘要:mounted() { document.addEventListener('visibilityChange', 事件处理函数) }, destoryed() { document.removeEventListener('visibilityChange', 事件处理函数) }, methods 阅读全文
posted @ 2020-12-10 17:30 糖锡 阅读(1365) 评论(0) 推荐(1)
摘要:// actions import { queryProductDetailsById } from '../service' /* * 异步 */ export const addAndGetProduct = ({ commit, state, getters }, params) => { c 阅读全文
posted @ 2020-12-09 14:42 糖锡 阅读(85) 评论(0) 推荐(0)
摘要:<template> <div class="about"> <h3>flex相关的属性</h3> <div class="parent"> <div class="son1"></div> <div class="son2"></div> <div class="son3"></div> <div 阅读全文
posted @ 2020-12-09 14:33 糖锡 阅读(140) 评论(0) 推荐(0)
摘要:console.log('判断页面是否有滚动条', this.hasScrollbar) const that = this that.count = 0 // 计数 that.scrollProxy = new Proxy({ hasScrollToEnd: !that.hasScrollbar, 阅读全文
posted @ 2020-12-01 15:13 糖锡 阅读(134) 评论(0) 推荐(0)