谷歌内核webkit
.container::-webkit-scrollbar { display: none; //SafariandChrome }
IE或者Firefox
.container { -ms-overflow-style: none; //IE 10+ overflow: -moz-scrollbars-none; //Firefox }
stopBodyScroll (isFixed) {
let bodyEl = document.body
let top = 0
if (isFixed) {
top = window.scrollY
bodyEl.style.position = 'fixed'
bodyEl.style.top = -top + 'px'
} else {
bodyEl.style.position = ''
bodyEl.style.top = ''
window.scrollTo(0, top) // 回到原先的top
}
}
参考地址:https://juejin.im/post/5a27cad56fb9a045186a9d94
gyp ERR!stackError: EACCES: permission denied, mkdir
sudo npm install -g appium --unsafe-perm=true --allow-root
watch: {
currentData: {
handler(newValue, oldValue) {
console.log(newValue.type,oldValue.type);
}
},
deep: true
},
解决方法:在computed中添加一个,在watch中监控这个
watch: {
currentData: {
handler(newValue, oldValue) {
console.log(newValue.type,oldValue.type);
}
},
deep: true
},
tmpType: {
handler(newValue, oldValue) {
if (newValue !== oldValue) {
//在此执行变化后需要的操作
}
},
deep: true
}
},
computed: {
tmpType: {
get: function() {
return this.data.data.type;
}
}
}
使用FormData传参数
const fd = new FormData();
fd.append("key", "value");
axios.post("host", fd, { headers: { "Content-Type": "application/x-www-form-urlencoded" }, }).then((res: any) => {}
img外层包一层,img设置100%
img {
height: 100%;
width: 100%;
}
<div class="ellipsis">
<div class="ellipsis-container">
<div class="ellipsis-content">content</div>
<div class="ellipsis-ghost">
<div class="ellipsis-placeholder"></div>
<div class="ellipsis-more">...更多</div>
</div>
</div>
</div>
.ellipsis {
position: relative;
background: rgb(230, 230, 230);
width: 100%;
max-height: 42px; /* h*n */
line-height: 21px;
overflow: hidden;
}
.ellipsis-container {
position: relative;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2; /* n */
font-size: 34px; /* 末位空白宽度 */
color: transparent;
}
.ellipsis-content {
color: #4a4a4a;
display: inline;/* 注掉变成省略号 */
vertical-align: top;
font-size: 17px; /* f */
line-height: 21px;
font-weight: bolder;
}
.ellipsis-ghost {
position: absolute;
z-index: 1;
top: 0;
left: 50%;
width: 100%;
height: 100%;
color: #000;
}
.ellipsis-ghost:before {
content: "";
display: block;
float: right;
width: 50%;
height: 100%;
}
.ellipsis-placeholder {
content: "";
display: block;
float: right;
width: 50%;
height: 38px; /* h*n */
}
.ellipsis-more {
position: relative;
float: right;
font-size: 12px; /* f */
width: 50px; /* w */
height: 18px; /* h */
margin-top: -18px; /* -h */
}
解决:需要设置
slidesPerView: "auto",
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。