
Js
熙冰
程序媛,菜鸟一枚,101状态码
展开
-
JS实现填空题
<template> <div class='fillIn'> <div v-for="(item, index) in list" :key="index" style="display: inline-block"> <el-input v-if="item.type===1" type="text" v-model="item.value"/> <span v-else>{{i.原创 2021-08-27 18:51:24 · 1511 阅读 · 0 评论 -
预览PDF文件流
<template> <div class='previewPdf' v-loading="loading" element-loading-text="加载中"> <section class="pdf-btn" id="previewBtn"> <el-button @click.stop="newPagePreview" type="primary" icon="el-icon-document">新页面预览PDF</el.原创 2021-02-19 11:19:50 · 2484 阅读 · 1 评论 -
下载文件判断返回JSON错误并提示
/** * 下载文件 * @param {*} url 接口url * @param {*} dataParams 要传给接口的参数 * @param {*} type 请求数据类型,默认application/json * @param {*} tip 是否需要下载文件失败时候接口返回json的提示 * @param {*} requestType 请求方式,默认post */ commonExportExcel (url, dataParams, t..原创 2021-02-07 19:18:17 · 831 阅读 · 1 评论 -
js去除首尾中英文逗号
/** 去除字符串首尾中英文逗号*/let str = ',,123456789,123456789,,'let one = str.replace(/^(,|,)+/, '').replace(/(,|,)+$/g, '')let two = str.replace(/^(,|,)+|(,|,)+$/g, '')console.log(one) // 123456789,12345...原创 2020-03-11 14:48:21 · 775 阅读 · 0 评论 -
使用JSON.parse(JSON.stringify(arr))进行深拷贝
/** 深度拷贝JSON.parse(JSON.stringify(arr))* JSON.parse(text[, reviver]):将数据转换为 JavaScript对象* JSON.stringify(value[, replacer[, space]]):将JavaScript对象转换为字符串* 深度拷贝的对象如果包括正则、函数、undefined、NaN等值,会出现问题* ...原创 2020-02-21 20:22:04 · 1768 阅读 · 0 评论 -
Jquery列表条件批量checkbox全选
<!DOCTYPE html><html><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body><div> <table id="main"></t...原创 2020-01-10 19:21:51 · 351 阅读 · 0 评论 -
可编辑div contenteditable = “true“限制字数输入框
<!DOCTYPE html><html><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <style> .main { position: relative; ...原创 2020-01-17 19:22:13 · 8268 阅读 · 6 评论 -
点击button后刷新页面
如果在Form中使用button标签,点击后会刷新页面,因为button除了Internet Explorer外的其他浏览器的type默认值是submit,具有提交表单的动作,要想避免button绑定事件同时会提交表单,为button按钮增加一个type=”button”属性。<button type="button">点击</button>...原创 2020-01-17 19:22:51 · 1555 阅读 · 1 评论