会员
周边
众包
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Wayhome😲
博客园
首页
新随笔
联系
订阅
管理
2022年5月12日
vue3封装useMapState、useMapGetters,以及模块化module的使用
摘要: 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'
阅读(779)
评论(0)
推荐(0)
2022年3月12日
时间格式化:时分秒左边加个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'
阅读(98)
评论(0)
推荐(0)
2022年3月10日
二次封装微信网络请求
摘要: 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'
阅读(27)
评论(0)
推荐(0)
2022年2月22日
封装的storage工具函数
摘要: class WHCache { constructor(isLocal = true) { this.storage = isLocal ? localStorage : sessionStorage; } setItem(key, value) { if (value) { this.storag
阅读全文
posted @ 2022-02-22 19:57 Wayhome'
阅读(57)
评论(0)
推荐(0)
2022年1月17日
vuex modules 命名的模块
摘要: 添加 namespaced: true 的方式使其成为带命名空间的模块 //decorate.js模块 export default { namespaced: true, state: { dragModule: { moduleIndex: -1, componentIndex: -1, },
阅读全文
posted @ 2022-01-17 13:39 Wayhome'
阅读(46)
评论(0)
推荐(0)
2022年1月12日
elementUI自定义表单验证,父组件控制多个子组件表单验证
摘要: //基础信息子组件 <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'
阅读(492)
评论(0)
推荐(0)
2022年1月7日
vuex执行完actions后,组件获取是否已经执行完毕的结果
摘要: //actions.js addStudentAction (context, payload) { function getData () { return new Promise((resolve, reject) => { setTimeout(() => { resolve({ name:
阅读全文
posted @ 2022-01-07 09:05 Wayhome'
阅读(247)
评论(0)
推荐(0)
2022年1月6日
vuex结合getters以及动态传值
摘要: 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'
阅读(209)
评论(0)
推荐(0)
2022年1月4日
v-model v-for 父子组件的使用
摘要: //父组件 <template> <div class='HelloWorld'> <!-- 这里不需要async,因为没有改变对象的地址,只是改变了对象里面的响应式值而已 --> <hello-world-com :arr="show.arr" /> 父组件:{{show.arr}} <butto
阅读全文
posted @ 2022-01-04 20:52 Wayhome'
阅读(113)
评论(0)
推荐(0)
2021年12月7日
js柯里化函数与promise请求
摘要: //柯里化函数 //request.js文件 const getOperateApi = apiName => curIndex =>para=> { switch (+curIndex) { case 1: apiName = 'ChosenChannel_' + apiName//每日精选活动商
阅读全文
posted @ 2021-12-07 09:41 Wayhome'
阅读(54)
评论(0)
推荐(0)
下一页
公告
// 侧边栏目录 // https://blog-static.cnblogs.com/files/douzujun/marvin.nav.my1502.css