零碎的积累

滑动时候警告:Unable to preventDefault inside passive event listener

* { touch-action: pan-y; }
//使用全局样式样式去掉

vue 点击事件路由传参,传多个参数

  this.$router.push({
        path: "/approvalList",
        query: {
          taskid: taskid,
          ind: ind,
          procinstid: procinstid,
          id: id,
          transactor: transactor,
          orgaid: orgaid,
          userName: userName
        }
  });

图片居中:
只限制宽或高,其他溢出隐藏居中显示

.img-item {
    max-width: 100%;
    max-height: 100%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

vue中监听input值的变化使用v-on:input="changeinput"

自动探测屏幕宽度,然后加载相应的CSS文件。
media=”screenand(max-device-width:400px)”
href=”tinyScreen.css”/>
media=”screenand(min-width:400px)and(max-device-width:600px)”
href=”smallScreen.css”/>
如果屏幕宽度在400像素到600像素之间,则加载smallScreen.css文件。

对于absolute定位的元素,用height:100%显然也是无效的,因为此时它已经脱离了文档流,此时它的高度由自身内容撑开。这是如果我希望它填满父盒子,怎么做?这里有个黑魔法,设置它的top,left,bottom,right均为0,这时盒子就会被拉伸至填满父盒子。

你可能感兴趣的:(零碎的积累)