- 博客(12)
- 收藏
- 关注
原创 js防抖节流
// 防抖 function debounce(fn, time) { let delay = time || 200; let timer; return function() { let th = this; let args = arguments; if (timer) { clearTimeout(timer); } timer = setTimeout(function() { timer = null; fn.apply(th, args); }
2021-10-31 16:12:03
61
1
原创 js 点击复制内容
<a-button id="btn" type="primary" style="margin-right:20px;">复制</a-button> <input id="demoInput" :value="detail.shareUrl" readonly style="width:100%;border:none;background-color:#fff;outline:none;"/> mounted() { c
2021-10-09 17:07:02
52
原创 vue-quill-editor的基本使用
<template> <quill-editor :style="'width:'+ width+';height:'+height" v-model="content" ref="myQuillEditor" :options="editorOption"> </quill-editor> </template> <script> import { quillEditor, Quill } from 'vue-quill-edit
2021-09-18 15:23:26
124
翻译 node爬取链接内容
var https = require("https"); //准备抓取的网站链接 var dataUrl = "https://mp.weixin.qq.com/s/YZSbOZT96GXKFBXEcQP3pA"; https.get(dataUrl, function (res) { var str = ""; //绑定方法,获取网页数据 res.on("data", function (chunk) { str += chunk; }) //数
2021-09-18 15:20:03
147
原创 小程序版本更新
const updateManager = wx.getUpdateManager(); updateManager.onUpdateReady(function () { wx.showModal({ title: '更新提示', content: '新版本已经准备好,是否重启应用?', success: function (res) { if (res.confirm) { ..
2021-08-07 13:08:28
50
原创 uni.request封装
let baseUrl = 'http://47.103.51.84:9091/' let request = function(url, data = {}, method = 'GET') { return new Promise((resole, reject) => { uni.showLoading({ title:'加载中...' }) uni.request({ url: baseUrl + url, method: method, data: da
2021-08-07 13:05:41
74
原创 flex弹性盒封装
.flex{ display: flex; } .flex-row{ flex-direction:row } .flex-column{ flex-direction:column } .flex1{ flex: 1; } .flex-space-between{ justify-content: space-between; } .flex-space-around{ justify-content: space-around; } .flex-content-start{ justify
2021-08-07 13:02:44
204
原创 uniapp使用事件图片缩放
html标签部分 <scroll-view scroll-x="true" scroll-y="true" style="width: 100vw;height: 100vh;overflow: auto;" @touchstart="startMap" @touchmove="moveMap"> <image class="img" mode="aspectFill" lazy-load='true' @click="bindimg" :src="map" :style="'wi
2021-04-11 20:09:15
764
翻译 小程序购物车抛物线效果实现
wxml加购事件和小球部分 <image src="../image/dpsp_add.png" bindtap="touchOnGoods" id="add_{{good.id}}" class="cart-add icon-add_circle"></image> <view class="good_box" hidden="{{hide_good_box}}" style="left: {{bus_x}}px; top: {{bus_y}}px;"> &l
2020-08-26 13:57:08
552
翻译 css抛物线效果
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style> #inner {
2020-08-14 17:04:03
99
翻译 js 浮点数精度问题(解决)
/ * 判断obj是否为一个整数 / function isInteger(obj) { return Math.floor(obj) === obj } */ 将一个浮点数转成整数,返回整数和倍数。如 3.14 >> 314,倍数是 100 @param floatNum {number} 小数 @return {object} {times:100, num: 314} /* function toInteger(floatNum) { var ret = {
2020-07-01 17:12:09
239
原创 小程序动画的使用(animation)
第一步:在wxml中 <button bindtap=" btn"> </button> <view class="slider" animation="{{ animations }}"></view> 第二步:在js中 在data中定义animations data:{animations:{} } 事件触发btn btn(e){ let that = this let...
2020-06-05 17:43:01
882
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人