- 博客(10)
- 收藏
- 关注
原创 小程序输入框金额校验
JS// 金额保留两位 inputDiscount: function (e) { let value = e.detail.value if (value != '') { value = value.replace(/[^\d.]/g, "") if (/^(\d?)+(\.\d{0,2})?$/.test(value)) {} else { value = value.substring(0, value.length - 1);
2022-05-07 19:34:57
658
原创 Vue-cli来构建Vue项目
首先需要安装Vue-cli:npm install -g vue-cli全局先安装Vue-cli,安装好了Vue-cli。就可以使用它来构建项目vue init webpack vw-layout进入到刚创建的vw-layout:cd vw-layout然后执行:npm run dev默认的页面效果:...
2021-12-16 14:41:23
685
原创 小程序自定义纯前端滑动图片校验
根据[微信小程序滑动验证拼图(有效果图)] 修改完成的,为了改变频繁操作dome造成的卡顿使用了movable-area组件,没有使用canvas组件(主要是不太会)(https://blog.youkuaiyun.com/qq_43764578/article/details/120471704?spm=1001.2101.3001.6650.1&utm_medium=distribute.pc_relevant.none-task-blog-2defaultCTRLISTdefault-1.no_searc
2021-11-19 15:17:11
1046
原创 微信小程序scroll-view 做类似锚点
只要替换scroll-into-view的值就可以了。(值为子元素的id名)JSPage({ data: { toView: 'green' }, tapTo(e) { console.log(e) this.setData({ toView: e.currentTarget.dataset.into }) }})})WXML<view class="container"> <view class="page-b
2021-11-17 13:59:43
308
转载 VUE 生成二维码
VUE 生成二维码(qrcodejs)npm install qrcodejs2 --saveimport QRCode from 'qrcodejs2';// 备注:在main中设置全局可使用 Vue.prototype.$qrCode = QRCode; ,页面中调用可直接使用 this.$qrCodehtml代码<div id="qrCode" ref="qrCodeDiv"></div>js代码new QRCode(this.$refs.qrCodeDi
2021-10-14 16:55:57
203
转载 js数组遍历方法总结
js数组遍历方法总结数组遍历方法1.for循环使用临时变量,将长度缓存起来,避免重复获取数组长度,当数组较大时优化效果才会比较明显。for(j = 0,len=arr.length; j < len; j++) { }2.foreach循环遍历数组中的每一项,没有返回值,对原数组没有影响,不支持IE//1 没有返回值arr.forEach((item,index,array)=>{ //执行代码})//参数:value数组中的当前项, index当前项的索
2021-10-09 17:38:57
278
转载 iview的table:自定义table表格中列头的标题和点击事件(renderHeader)
`<Tableclass=“table”:columns=“columns1”:data=“tableData”highlight-row:max-height=“500”border@on-selection-change=“onSelectionChange”@on-row-click=“onRowClick”>columns1: [{title: ‘重量’,slot: ‘weight’,align: ‘center’,key: ‘weight’,r
2020-09-24 16:56:28
1921
转载 iview表格中render 下拉框
{ title:'邮费计算方式', slot:'freight', align:'center', minWidth:160, render: (h, params) => { if(this.freightList.length===1){ this.data1[params.index].freightType = this.freightList[0].keyId return h('...
2020-04-15 11:06:38
471
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人