2023年9月5日

js 原生方法请求接口

摘要: XNLHttpRequest (xhr)介绍: XMLHttpRequest(简称xhr)是浏览器提供的JavaScript对象,通过它,可以 请求服务器上的数据资源。 在jQuery中封装的AJAX函数,就是基于xhr,然后封装出jq中的ajax,然后就可以调用出get、post、ajax()三个 阅读全文

posted @ 2023-09-05 13:46 一名小学生呀 阅读(719) 评论(0) 推荐(0) 编辑

前端实现图片验证效果

摘要: 效果图: // 页面执行 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>图形验证码</title> </head> <body> <div id="v_container" style="width: 200px;height 阅读全文

posted @ 2023-09-05 11:44 一名小学生呀 阅读(49) 评论(0) 推荐(0) 编辑

input 禁止输入中文

摘要: 推荐直接使用正则,简单! 也可以写个方法校验 // 1. 正则匹配 <input type="text" id="tel_id" onkeyup="value=value.replace(/[\u4e00-\u9fa5]/ig,'')"/> // 2. 方法校验 // onpaste 元素上粘贴文本 阅读全文

posted @ 2023-09-05 11:39 一名小学生呀 阅读(568) 评论(0) 推荐(0) 编辑

vue项目全局api接口封装

摘要: 项目通常情况下,api封装放在src 下utils 文件下 request.js // 安装 axios cnpm install axios --save // 新建request.js// 通常项目的拦截,封装方法都封装在这里 import axios from 'axios' const in 阅读全文

posted @ 2023-09-05 11:06 一名小学生呀 阅读(116) 评论(0) 推荐(0) 编辑

element vue表单form下多个form-item项循环校验

摘要: 效果图: ps:重点注意 prop 值 <el-form ref="fromRef" :model="formData" :rules="rules" label-width="100px" > <el-row v-for="(item,index) in formData.allopatricCo 阅读全文

posted @ 2023-09-05 10:58 一名小学生呀 阅读(262) 评论(0) 推荐(0) 编辑

页面加水印

摘要: 效果图: 实现思路: 需要一个透明蒙版盖住页面,然后将水印信息循环展示出来,展示完成后将蒙版旋转倾斜,然后为了让水印不影响下层页面功能的正常使用,需要使用pointer-events: none;属性让事件穿透到下面去 // 定义一个水印组件 <template> <view class="make 阅读全文

posted @ 2023-09-05 09:35 一名小学生呀 阅读(19) 评论(0) 推荐(0) 编辑

导航