问题: 使用富文本编辑上传图片后,小程序渲染后图片之间有空隙前端
// 解决办法:
vertical-align: top;
outline-width: 0px;
复制代码
问题:ngnix部署成功,ping成功页面外网仍是没法访问?vue
一、静态资源不能放到root // 根目录下的文件夹中没有权限访问,
二、记得开启服务器防火墙和阿里云控制台防火墙
复制代码
Array.prototype.dupRemove = function(){
var arr=[];
for(var i=0;i<this.length;i++){
if(arr.indexOf(this[i]) == -1){
arr.push(this[i]);
}
}
return arr;
}
let arr = [1,2,3,4,5,6,1,3,12,1]
arr.dupRemove() // [1, 2, 3, 4, 5, 6, 12]
复制代码
var timer = null
var scroll = {
methods: {
scrollToTarget (target, animation = true) {
if (!animation) {
document.body.scrollTop = document.documentElement.scrollTop = 0
return
}
let currentNum = document.body.scrollTop || document.documentElement.scrollTop
let t = 0
clearInterval(timer)
let dir = 1
if (target > currentNum) {
dir = -1
}
timer = setInterval(() => {
// 匀加速运动
t++
currentNum -= (2 * t * dir)
document.body.scrollTop = document.documentElement.scrollTop = currentNum
if ((dir === 1 && currentNum <= target) || (dir === -1 && currentNum >= target)) {
document.body.scrollTop = document.documentElement.scrollTop = target
clearInterval(timer)
}
}, 16.7)
}
}
}
export { scroll }
复制代码