摘要: vue3封装useMapState import { mapState, mapGetters, useStore } from 'vuex'; import { computed } from 'vue'; export function useMapStore(data, type) { con 阅读全文
posted @ 2022-05-12 19:58 Wayhome' 阅读(704) 评论(0) 推荐(0) 编辑
摘要: // 12 -> 12 // 5 -> 05 function padLeftZero(time) { time = time + "" return ("00" + time).slice(time.length) } function formatDuration(duration) { dur 阅读全文
posted @ 2022-03-12 14:39 Wayhome' 阅读(84) 评论(0) 推荐(0) 编辑
摘要: class WHRequest { constructor(){ this.BASE_URL='' } request(url, method, params) { return new Promise((resolve, reject) => { wx.request({ url:this.BAS 阅读全文
posted @ 2022-03-10 08:48 Wayhome' 阅读(25) 评论(0) 推荐(0) 编辑
摘要: class WHCache { constructor(isLocal = true) { this.storage = isLocal ? localStorage : sessionStorage; } setItem(key, value) { if (value) { this.storag 阅读全文
posted @ 2022-02-22 19:57 Wayhome' 阅读(50) 评论(0) 推荐(0) 编辑
摘要: 添加 namespaced: true 的方式使其成为带命名空间的模块 //decorate.js模块 export default { namespaced: true, state: { dragModule: { moduleIndex: -1, componentIndex: -1, }, 阅读全文
posted @ 2022-01-17 13:39 Wayhome' 阅读(39) 评论(0) 推荐(0) 编辑
摘要: //基础信息子组件 <template> <div class='BasisInfo'> <div class="basis-info-wrap"> <div class="basis-info-title">基础信息</div> <el-form ref="ruleForm" size="mini 阅读全文
posted @ 2022-01-12 11:57 Wayhome' 阅读(452) 评论(0) 推荐(0) 编辑
摘要: //actions.js addStudentAction (context, payload) { function getData () { return new Promise((resolve, reject) => { setTimeout(() => { resolve({ name: 阅读全文
posted @ 2022-01-07 09:05 Wayhome' 阅读(228) 评论(0) 推荐(0) 编辑
摘要: vuex结合getters以及动态传值 获取年龄大于${age}的学生 <div><input type="text" v-model="age" placeholder="请输入年龄"></div> <div v-for="item in moreAgeStu(age)" :key="item.i 阅读全文
posted @ 2022-01-06 09:05 Wayhome' 阅读(204) 评论(0) 推荐(0) 编辑
摘要: //父组件 <template> <div class='HelloWorld'> <!-- 这里不需要async,因为没有改变对象的地址,只是改变了对象里面的响应式值而已 --> <hello-world-com :arr="show.arr" /> 父组件:{{show.arr}} <butto 阅读全文
posted @ 2022-01-04 20:52 Wayhome' 阅读(107) 评论(0) 推荐(0) 编辑
摘要: //柯里化函数 //request.js文件 const getOperateApi = apiName => curIndex =>para=> { switch (+curIndex) { case 1: apiName = 'ChosenChannel_' + apiName//每日精选活动商 阅读全文
posted @ 2021-12-07 09:41 Wayhome' 阅读(47) 评论(0) 推荐(0) 编辑
// 侧边栏目录 // https://blog-static.cnblogs.com/files/douzujun/marvin.nav.my1502.css