- 博客(26)
- 收藏
- 关注
原创 通过换行或者回车把多行数字分割成数组
textarea通过换行或者回车把多行数字分割成数组 <textarea clase="tra"></textarea> <div class="btn"></div> $('.btn').click(function() { var result = $('.tra').val().split(/[(\r\n)\r\n]+/); console.log(result); })...
2022-01-15 15:41:15
864
原创 改变input的placeholder样式、去掉input标签获取焦点后的边框
改变input的placeholder样式 input::-webkit-input-placeholder { /* Chrome/Opera/Safari */ color: #DCDFE6; } input::-moz-placeholder { /* Firefox 19+ */ color: #DCDFE6; } input:-ms-input-placeholder { /* IE 10+ */ color: #DCDFE6;
2022-01-15 15:40:30
512
原创 checkbox 全选 全不选功能模块
<table class="header-table" cellspacing="0" cellpadding="0" border="0"><thead> <tr> <th> <input class="checkall" type="checkbox" > </th> <th class="header-box_th_2">序号</t
2022-01-15 15:38:40
329
原创 实现文本溢出显示省略号
css实现// 单行文本.item { width:100px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}// 多行文本.item { width: 100px; display: -webkit-box; -webkit-box-orient: vertical; text-overflow: ellipsis; -webkit-line-clamp: 3; ov
2022-01-15 11:15:33
152
原创 关于数组不规则下标怎么循环输出
var data = new Array() data[0] = "标题" data[1] = "11111" data[2] = "22222" data[9] = "99999" for (let i in data) { if(i!=0){ //忽略第一个 console.log(data[i]) }}
2022-01-15 11:13:56
202
原创 根据索引值删除数组数据
let arr = [2,3,4,5,6]let delInd = [0,2,3]for(let i = 0;i < delInd.length ;i++){ arr.splice(delInd[i]-i,1)}
2022-01-15 11:12:37
1627
原创 JS判断输入框是否为空
方法一 // 判断输入框是否全为回车、空格或为空 export function strTest(str) { for (var i = 0;(str.charAt(i) == ' ') && i < str.length; i++); if (i == str.length) return ''; //整个字符串是空格 var newstr = str.substr(i); for (var i = newstr.length - 1; news
2022-01-15 11:06:21
4441
原创 Vant Swipe 轮播报错:Cannot read properties of null (reading ‘width‘)
监听接口数据,设置一个延时器,让其在数据渲染之后重绘轮播图watch:{ dataList(val){ var _this = this; setTimeout(() => { _this.$refs.swipe.resize(); }, 500); }},
2022-01-15 09:21:48
3384
2
原创 Vue 判断页面内图片是否渲染完成
vue 通过complete判断图片是否渲染完成1.首先获取到接口数据并赋值在页面上<div class="box" v-for="(item,index) in dataList" :key="index"> <img ref="imgRef" :src="item.url" ></div>2.通过watch进行监听 watch:{ dataList(val){ this.$nextTick(function() { //通过ref
2022-01-14 18:01:13
6452
原创 vue3笔记-侦听器watch
侦听器-watch<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <ti
2021-08-29 17:58:25
282
原创 JQuery A页面跳转传值,在B页面获取到传值内容并渲染页面
A页面 内容<!DOCTYPE html><html><head> <meta charset="UTF-8"> <title></title> <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script></head><body> <button
2021-02-24 13:15:50
2498
原创 使用iframe不跳转页面直接弹出打印框
使用iframe 不跳转页面直接弹出打印框打开模板页可以直接跳出打印,也可以在主页面点击通过iframe调用模板页面主页面<button type="button" id="printBtn">打印</button><iframe frameborder="0" src="" id="printFrame" style="width: 0;height: 0;"></iframe><script src="https://cdn.staticf
2020-11-12 17:59:45
582
1
原创 前端问题小记
JS问题小记textarea通过换行或者回车把多行数字分割成数组textarea通过换行或者回车把多行数字分割成数组 <textarea clase="ipt"></textarea> <div class="btn"></div> $('.btn').click(function() { var result = $('.ipt').val().split(/[(\r\n)\r\n]+/); console.log(re
2020-11-09 16:53:58
215
2
转载 微信小程序 -swiper实现左右点击切换,通过css改变指示点样式
https://blog.youkuaiyun.com/weixin_45102071/article/details/105733227
2020-11-04 10:24:19
2293
转载 使用FormData对象上传文件
使用FormData对象添加字段方式上传文件html代码<div id="uploadForm"> <input id="file" type="file"/> <button id="upload" type="button">upload</button></div>javascript代码$('#upload').click(function() { var formData = new FormData();
2020-10-31 16:36:24
774
3
原创 引用JsBarcode插件 生成一维码
//引入<script src="js/jquery-1.8.0.min.js"></script><script src="js/JsBarcode.all.js"></script>//html<svg id="barcode"></svg><!-- or --><canvas id="barcode"></canvas><!-- or --><img id="
2020-10-31 16:17:07
403
转载 Vue的devtools构建报错npm ERR! code ELIFECYCLE解决办法
使用npm run build 安装vue的devtools工具时报以下的错误提示npm ERR! code ELIFECYCLEnpm ERR! errno 1npm ERR! vue-devtools@5.3.3 build: `cd packages/shell-chrome && cross-env NODE_ENV=production webpack --progress --hide-modules`npm ERR! Exit status 1npm ERR!npm
2020-08-05 16:05:00
2871
2
原创 npm 安装出错
npm 安装出错npm ERR! request to https://registry.npm.taobao.org/gulp-htmlmin failed, reason: getaddrinfo EAI_AGAIN registry.npm.taobao.org registry.npm.taobao.org:443npm 安装 gulp-htmlmin 时出现PS D:\Projects\test\gulp-demo> npm install gulp-htmlminnpm ERR!
2020-06-26 14:32:45
5654
1
原创 uni-app下拉刷新、上拉页面加载数据,实现分页效果
上拉刷新需配置 pages.json{ "path": "pages/index/index", "style": { "navigationBarTitleText": "首页", "enablePullDownRefresh": true //哪个页面需要下拉刷新就在哪个页面配置里加上这一句话 }}template<text class="loading-text"> {{loadingType === 0 ? contentText.contentdo
2020-05-26 15:15:42
5498
4
原创 uni-app实现单选、多选改变样式
<view class="skill" > <!-- 单选 --> <view class="skill-item" :class="{'active': isChange == index}" v-for="(item, index) in list" :key="index" @click="clickBtn(index)"> <!-- 多选 --> <!-- <view class="skill-item" :class="{'ac
2020-05-21 19:22:16
8610
8
原创 从A页面跳转到B页面,在B页面使用uni.navigateBack返回数据到A页面
从A页面跳转//for循环出prolist 里的内容显示在页面上<view class="" v-for="(item,index) in proList" :key="index" > <view>{{item.title}}</view> <view>{{item.content}}</view></view> data() { return { proList:[] , list:'', }
2020-05-16 00:20:42
1279
原创 uni-app 从本地相册选择图片或使用相机拍照
页面部分<view>上传图片 {{imageList.length}}/9</view><view class="uni-list list-pd"> <view class="uni-uploader__files"> <block v-for="(image,index) in imageList" :key="index"> <view class="uni-uploader__file"> <im
2020-05-15 11:02:09
6544
7
原创 通过年月获取当月的第一天和最后一天
研究同事代码发现这个方法,原方法是用来获取上月、本月、下月的yyyy-mm-dd格式日期,getMonth(type, months) { //getMonth(type,months) //type为字符串类型,有两种选择,"s"代表开始,"e"代表结束,months为数字类型,不传或0代表本月,-1代表上月,1代表下月 //getMonth("s",1) //得到下月第...
2020-05-07 16:17:01
2651
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人