- 博客(65)
- 问答 (1)
- 收藏
- 关注
原创 vue2中遇到的问题与解决方案(自用)
比如,前端样式定义后由接口返回想渲染的样式,如果此时直接使用v-html,那么vue的自定义组件或者ui框架的组件是会被直接引用不能编译成功。
2024-12-31 10:01:46
340
原创 vue3项目中遇到的问题及解决方案
在vue3开发过程中遇到的问题及解决方案记录本文是为了给自己做一个笔记Uncaught ReferenceError: process is not defined_uncaught (in promise) referenceerror: process is n-优快云博客文章浏览阅读2.9k次。最近在搞老项目升级,将Vue2.6.11里的vuecli5.0.8升级到vite最新版本4.4.9,中间遇到不少问题,有机会以后做记录。
2024-12-20 11:51:31
488
原创 编程技巧(一)
1 toLocaleString 可以用来格式化,比如数字的格式化 15368.toLocaleString () =>15,368。
2023-04-12 10:01:22
116
原创 初学ts(一)
(1)function add<T>(arg:T):T{ // 约束传入参数 类型 和 返回值类型一致;let a2(x:number,y:number)=>number =a (在interface 中 定义一个对象 就要使用这种)(2)泛型约束(当函数里面使用了length 入参必须是含有length的 那么就要在初始化T的时候 给他一个继承)类型断言 function add(x:number | string):number{1、 interface (接口) :用来描述和约束对象解构的。
2023-04-12 10:00:55
587
原创 初学vue3
在使用setup 函数的时候 需要 将reactive 的函数 return 出去;这时候如果使用了对象的解构 会使return出去的数据类型改变;这时候需要使用toRefs()将解构的对象保持ref 响应式类型。4、vue3 的响应式是es6 的proxy 实现解决了vue2的object.defineProperty 监听不到对象新增属性 和 直接修改 数组值;proxy 可以直接监听到对象的key的变化。1 、ref 是一个响应式函数 (也是一个类型)2 、computed 是一个回调函数。
2023-04-12 09:29:14
71
原创 echarts 使用遇到的问题
1 有时候设置了colros;这时候鼠标经过图表 图表会消失 因为colos 里面使用了rgb 这时候要改成rgba 其中a 要写成1。
2023-03-29 17:31:32
130
翻译 js设置rem 实现媒体查询
(function (doc, win) { var docEl = doc.documentElement, resizeEvt = 'orientationchange' in win ? 'orientationchange' : 'resize', recalc = function () { var clientWidth = docEl...
2018-11-15 17:13:38
407
转载 阳历转阴历
var LunarDate = { madd: new Array(0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334), HsString: '甲乙丙丁戊己庚辛壬癸', EbString: '子丑寅卯辰巳午未申酉戌亥', NumString: "...
2018-04-19 14:29:54
227
转载 rem responsive js
new function () {var _self = this;_self.width = 750;//设置默认最大宽度_self.fontSize = 100;//默认字体大小_self.widthProportion = function () {var _dom = (document.body && document.body.clientWid
2017-12-21 11:25:41
293
转载 移动端摄像头
HTML5 GetUserMedia Demo var video = document.querySelector('video'); var audio, audioType; var canvas1 = document
2017-10-13 18:29:33
372
原创 h5新增文件图片上传
.info{ width: 500px; min-height: 200px; border: 1px solid red; margin-top:30px; text-shadow: 4px 3px 1px #333; } 请选择图片文件: var input=do
2017-10-12 10:27:26
813
转载 杨辉三角形
window.onload=function(){ function countNum(x){ if(x==1){return 1} //函数输入1直接返回1 var arr=[[1],[1,1]] //定义数组初始值 for(var i=2;i arr[i]=[
2017-09-22 16:56:56
310
转载 css如何让两个div高度一致
Document .box{ width: 200px; display:table; margin:0 auto; } .one{ width: 100px; background-color: pi
2017-09-15 14:19:39
6396
2
转载 验证码前端
js验证码.code { background:url(code_bg.jpg); font-family:Arial; font-style:italic; color:blue; font-size:30px; border:0; padding:2px 3px; letter-spacing:3px; font-weight:bolder;
2017-09-01 13:22:06
230
翻译 jquery.ajax调用新浪/网易k线数据 具体操作ajax
$.ajax({ //'http://img1.money.126.net/data/hs/time/today/0600123.json' 网易数据源 url:"http://hq.sinajs.cn/list=sz000007",//新浪数据源 type:"get", dataType: 'scr
2017-08-30 15:06:03
567
原创 简单的js实现放大镜效果
* { margin: 0; padding: 0; } .box { width: 350px; height: 350px; margin: 100px; border: 1px solid #c
2017-08-23 16:51:17
439
原创 使用html5的文件操作实现读取图片
.info{ width: 500px; min-height: 200px; border: 1px solid red; margin-top:30px; text-shadow: 4px 3px 1px #333; } 请选择图片文件: var input=do
2017-08-23 14:00:48
983
原创 原生js旋转木马
旋转木马轮播图 @charset "UTF-8";/*初始化 reset*/blockquote, body, button, dd, dl, dt, fieldset, form, h1, h2, h3, h4, h5, h6, hr, input, legend, li, ol, p, pre, td, textarea, th, ul { margin: 0
2017-08-18 18:20:29
734
转载 原生js仿百度搜索框
Title fieldset, img, input, button { border: none; padding: 0; margin: 0; outline-style: none; } ul, ol {
2017-08-01 16:29:14
1442
1
转载 判断2个日期的时间差多少天
function getDays(strDateStart,strDateEnd){ var strSeparator = "-"; //日期分隔符 var oDate1; var oDate2; var iDays; oDate1= strDateStart.split(strSeparator); oDate2= strDateEnd.split
2017-07-20 16:42:49
740
转载 浏览器的内核分别是什么?经常遇到的浏览器的兼容性有哪些?原因,解决方法是什么,常用hack的技巧 ? * IE浏览器的内核Trident、 Mozilla的Gecko、google的WebKi
浏览器的内核分别是什么?经常遇到的浏览器的兼容性有哪些?原因,解决方法是什么,常用hack的技巧 ? * IE浏览器的内核Trident、 Mozilla的Gecko、google的WebKit、Opera内核Presto; * png24为的图片在iE6浏览器上出现背景,解决方案是做成PNG8. * 浏览器默认的margin和padding不同。解决方案是加一个全局
2017-07-19 17:36:24
1436
转载 页面长时间不操作处理
var myTime = setTimeout("Timeout()", 6000); function resetTime() { clearTimeout(myTime); myTime = setTimeout('Timeout()', 6000); } function Timeout() { alert("您的登录已超时,
2017-07-19 11:15:46
1492
原创 封装一个clone函数(对不同的类型进行值复制)
function clone(Obj) { var buf; if (Obj instanceof Array) { buf = [];//创建一个空的数组 var i = Obj.length; while (i--) {
2017-07-05 16:19:15
314
原创 讲伪数组转化成数组||定义一个log代替console.log
function log(){ var args = Array.prototype.slice.call(arguments); //为了使用unshift数组方法,将argument转化为真正的数组 args.unshift('(app)'); console.log.apply(console, args); };log("hello
2017-07-05 14:06:37
606
原创 h5的拖拽事件 ondrop 实现鼠标跟随 移动盒子
.box,.target{ width: 400px; height: 400px; border: 1px solid #000; } span{ width: 100px; height: 100px; border: 1px solid #000; border-radius
2017-07-05 13:15:50
2236
原创 使用template (模板引擎写的demo)
template *{ margin: 0; padding: 0; list-style: none; } .box{ margin: 0 auto; width: 800px; }
2017-07-05 11:25:16
747
转载 设置cookie (tips提示框第一次进入显示 一天内再进入隐藏)
function setcookie(name,value,days){ //给cookie增加一个时间变量 var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); //设置过期时间为days天 document.cookie = name + "="+ escape (value) + "
2017-07-05 10:03:28
961
转载 写一个全局的方法替换字符串中相应位置的内容
(function(window){ function fn(str){ this.str=str; } fn.prototype.format = function(){ var arg =arguments; return this.str.replace(/\{(\d+)\}/ig,function(a
2017-07-05 09:35:50
600
转载 通用的事件侦听器函数
// event(事件)工具集,来源:https://github.com/markyunmarkyun.Event = { // 页面加载完成后 readyEvent : function(fn) { if (fn==null) { fn=document; } var oldonload =
2017-07-04 14:02:07
248
翻译 三级联动
html>lang="en"> charset="UTF-8"> 省市的三级联动的菜单 src="../jquery-3.2.1.min.js"> rel="stylesheet" href="./node_modules/bootstrap/dist/css/bootstrap.min.css"> src="./node_modules/bootstr
2017-07-03 16:43:53
979
原创 簡單的移动端菜单栏滑屏demo
html>lang="en"> charset="UTF-8"> Document http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> name="viewport" content="width=device-width, initial-scale=1"> *{
2017-07-03 15:51:40
677
翻译 currentStyle,runtimeStyle,getComputedStyle style
引入currentStyle,runtimeStyle,getComputedStyle style 标准的样式,可能是由style属性指定的!runtimeStyle 运行时的样式!如果与style的属性重叠,将覆盖style的属性!currentStyle 指 style 和 runtimeStyle 的结合! 通过currentStyle就可以获取到通过内联或外部引用的CSS
2017-06-28 11:28:45
221
翻译 简易封装移动端touch事件
// 移动端的点击事件会有300ms的延迟 优化// 触发点击事件是// 先触发了touch事件 如果是点击事件 没有touchmove事件// 触屏开始 和 结束 的时间差 要小于 150ms/** 参数说明* obj:绑定点击事件的对象* callback: 点击事件触发后 要执行的代码* *//* 全局污染 */// 命名空间 避免全局
2017-06-25 16:02:12
424
翻译 js实现矩形框选
"http://www.w3.org/TR/html4/strict.dtd">鼠标框选效果 *{ padding:0; margin:0; } #bottom{ position:absolute; bottom:0px; width:100%; height:40px; border:1px solid #000;
2017-06-22 10:20:09
4878
2
翻译 鼠标右键 左键 滚轮事件
window.onload = function(){ //去掉默认的contextmenu事件,否则会和右键事件同时出现。 document.oncontextmenu = function(e){ e.preventDefault();//阻止默认事件 }; docu
2017-06-22 09:58:43
619
空空如也
在css中对于图片应该怎么处理
2017-06-06
TA创建的收藏夹 TA关注的收藏夹
TA关注的人