- 博客(21)
- 收藏
- 关注
原创 弹窗v-viewer点击第二次后没办法预览图片
弹窗v-viewer点击第二次后没办法预览图片,viewer.update() 没用viewer.destroyed()加viewer.update()也没用既然viewer可以销毁,为什么不把弹窗给销毁呢?命名一个refresh:true当控制组件弹出的modals为false,refresh也为false,第二次打开的时候预览图片也能预览了...
2022-02-12 15:01:42
944
原创 Vue生命周期
beforeCreate(创建前),created(创建后),beforeMount(载入前),mounted(载入后),beforeUpdate(更新前),updated(更新后),beforeDestroy(销毁前),destroyed(销毁后)...
2019-05-28 16:59:35
137
原创 箭头函数可以替换let _this = this
let _this = thislet _this = this; _this.$axios.get("https://jsonplaceholder.typicode.com/posts") .then(response => {// console.log(response); ...
2019-05-17 10:09:29
2297
原创 要重新渲染数据
var _this = this _this.setData({ goodsId: e.currentTarget.dataset.goodsId, coverImg: e.currentTarget.dataset.coverImg, goodsName: e.currentTarget.dataset.goodsName, specLis...
2019-04-28 17:30:10
733
原创 onLoad只能执行一次
onLoad: function (options) { var _this = this var p = { date: _this.data.dateTime ? _this.data.dateTime : date[0].time, act_type: 23, pageSize: 100 } console.log(this.da...
2019-04-28 17:28:30
4353
原创 循环tab
<view class='classify'> <view class='classify-text'> <scroll-view class='scroll-view' scroll-x="true"> <block> <view class="{{index===id?'red':'d...
2019-04-08 18:15:12
340
原创 文字省略号
如果文字要把超出内容变成省略号,要在文字上面加上这两句 text-overflow: ellipsis; overflow: hidden;还要在父元素那边加上 white-space: nowrap; overflow: hidden;不然文字会换行,或者直接省略后面的文字,不会出现省略号,或者超出文本框...
2019-04-01 15:51:44
302
原创 小程序轮播效果
<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" vertical="{{vertical}}"> <block wx:for="{{texts}}" wx:key=""> <...
2019-03-29 17:21:13
270
原创 js手风琴效果
<script> function accordion() { var div = document.getElementById('content'); var divs = div.getElementsByTagName('p'); var i = 0; var t = null; for(i...
2019-03-22 17:41:55
997
原创 排他思想
//首先获取所有的livar box = document.getElementsByClassName("box");//循环调用函数 有几个box,调用几次 互不影响for(var i = 0;i<box.length;i++){ fn(box[i]);}function fn(ele){ var allLis = ele.getElementsByTagNam...
2019-03-20 19:32:36
273
原创 移动必须加上定位
#mask2{ width: 10px; background-color: black; border-radius: 5px; cursor: pointer;}//跟随屏幕移动栏var follow1 = $('follow_1');var follow1Left = follow1.children[0];var follow1Right = f...
2019-03-18 16:22:36
233
原创 进度条
shank.onmousedown=function (event) { //获取初始位置 var offsetLeft = event.clientX - shank.offsetLeft; navBox5.onmousemove=function (event) { //获取鼠标移动 var x = event.clientX - offsetLeft;...
2019-03-15 19:15:40
94
原创 放大镜效果
var box = $('nav_box1');var smallBox = box.children[0];var mask = $('mask');var bigBox = $('big_box');var bigImg = bigBox.children[0];smallBox.onmouseover=function () { mask.style.display='bloc...
2019-03-13 19:47:33
148
原创 数组后面要用中括号!!!!!!
<script> function f1() { var arr=[1000,2000,2500,3000,1800,1900]; for (var i=0;i<arr.length;i++){ if(arr(i)>2000){ arr.splice(i--,1) } c...
2019-03-06 16:33:30
3727
原创 JavaScript对象
JavaScript 对象JavaScript 中的所有事物都是对象:字符串、数值、数组、函数…此外,JavaScript 允许自定义对象。所有事物都是对象JavaScript 提供多个内建对象,比如 String、Date、Array 等等。 对象只是带有属性和方法的特殊数据类型。布尔型可以是一个对象。数字型可以是一个对象。字符串也可以是一个对象日期是一个对象数学和正则表达式也...
2019-03-04 17:57:06
85
原创 数组
var arr=["张三","李四",18,1995,www.it666.com]; var b=""; for (var i=0;i<arr.length;i++){ if(arr[i]==it666){ b=arr(i) } console.log(b) }错误 var arr=["张三"...
2019-03-01 17:04:01
96
原创 box-sizing
.bottom_content>ul>li { width: 250px; height: 300px; float: left; position: relative; background-color: white; box-sizing: border-box; border: 1px solid #888888;}b...
2019-02-27 16:20:29
96
原创 动画-js停顿效果
.content_con_left ul{width: 2000px;height: 300px;animation: flash linear 3s 0s infinite alternate;}@keyframes flash {0%{margin-left: 0;}25%{margin-left: -500px;}50%{margin-left: -1000px;...
2019-02-25 11:52:32
510
原创 边距清零
在企业开发中,一定要在css里加上body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0}把所有边距都清零...
2019-02-20 14:07:27
303
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人