
uni-app浏览历史记录功能实现 searchStart:function(){ let_this=this; if(_this.searchText==''){//搜索关键词为空 uni.showToast({//提示信息 title:'请输入关键字', icon:'none', 阅读全文
实现功能 1.点击搜索,把搜索的值存入本地记录,并展示 2.搜索相同的值,要删除旧数据,把新数据放进数组首位 3.清空历史记录 <template> <view> <!--搜索框--> <viewclass="search"> 阅读全文
//放进去判断的变量:variable if(!(/(^[1-9]\d*$)/.test(variable)){ //如果不是数字... } if(!/^\d+(\.\d{1,2})?$/.test(variable)){ //如果小数点后不是2位... } if(!(/^1[阅读全文
遇到一个问题,在操作页面跳转时候,使用window.location.href无法进行跳转,经过一系列的排查,和分析,最终解决这个问题。 $("#quit").click(function(){ if(confirm("你确定要退出嘛?")){ window.location.href='阅读全文
1、这样代码时间无效,会直接跳转 setTimeout(window.location.href='http://www.anticqp.cn/',3000); 2、这样是正常的解决方案 setTimeout(function(){window.location.href='http://ww阅读全文
点击下载示例压缩包:ASPsnakDemo.rar <%@LANGUAGE="VBSCRIPT"CODEPAGE="65001"%> <!doctypehtml> <html> <head> <metacharset="ut阅读全文
用法1:替换数组的值 leta=[1,2,3],b=[4,5] console.log(Object.assign(a,b));//后面的值覆盖前面的值,[4,5,3] 用法2:为对象添加属性 下面是es5的写法:this.xxx=xxx //es5的写法 classTe阅读全文
一、scale()方法 缩放,指的是“缩小”和“放大”。在CSS3中,我们可以使用scale()方法来将元素根据中心原点进行缩放。 跟translate()方法一样,缩放scale()方法也有3种情况: (1)scaleX(x):元素仅水平方向缩放(X轴缩放); (2)scaleY(y):元阅读全文
一、数组更新 push()新增到最后一个 pop()删除最后一个 shift()删除前一个 unshift()新增到第一个 splice()删除所有 sort() reverse()第一个和最后一个交换 示例: nameList:[{name:'张三'},{name:'李四'}阅读全文
这个是uni-app自定义loading的组件,以下是代码 <template> <!--visible控制toast的显隐,text为提示文本--> <viewclass="loading-toast"v-if="visible"> <阅读全文
<template> <view> <viewclass="ld"> <viewclass="left"> <scroll-view:scroll-y="true":scroll-with-animation="true":scroll-阅读全文
HTML <viewclass="end-title"> <view@tap="change(0)":class="{btna:btnnum==0}">基本信息</view> <view@tap="change(1)":class="{btn阅读全文
Vue.component('myComponent',{ props:{ //基础类型检测(`null`意思是任何类型都可以) propA:Number, //多种类型 propB:[String,Number], //必传且是字符串 propC:{ type:String, r阅读全文
uni-app是一款强大的前端框架,可以打包原生app、手机h5页面、微信小程序。 但是有一个问题就是原生的app和微信小程序是有一定的区别的,因为app有标题栏,返回键,而微信小程序自带了,那判断平台的语法就很重要了 1、uni-app编译为小程序时均为生产环境,可用过uni.getS阅读全文
<template> <view> <viewv-for="(item,index)instudents"class="persons"@click="menuClick"v-bind:id="index">{{index}}-{{item.name}}<阅读全文
我最喜欢的操作是@tap="这个是自定义点击事件"总觉得比@click好用。 tap和click的区别: 两者都会在点击时触发,但是在web手机端,clikc会有200-300ms的延时,所以要用tap代替click作为点击事件,singleTap和doubleTap分别作为单次点击和双击,阅读全文
事件映射表,左侧为WEB事件,右侧为uni-app对应事件 { click:'tap', touchstart:'touchstart', touchmove:'touchmove', touchcancel:'touchcancel', touchend:'touchend',阅读全文
<template> <view> <viewv-for="(item,index)instudents"> <viewclass="persons">{{index}}-{{item.name}}</view> </view阅读全文
<template> <view> <viewv-for="(item,index)instudents"> <viewclass="persons">{{index}}-{{item.name}}</view> </view阅读全文
<template> <view> 这个就是开始循环的段落 <viewv-for="(item,index)instudents"> <viewclass="persons">{{index}}-{{item.name}}</view&g阅读全文