slice(),scrollLeft,watch监听路由变化,onclick,DOMContentLoaded

245 阅读1分钟
slice()
a = '1234'
a.slice(1) // a log '234'

scrollLeft // element.scrollLeft 获取该节点的横向滚动条偏移位置

watch:{
    $route(to, from){
        console.log(to.path)
    }
}

element.onclick = function(){}

document.addEventListener('DOMContentLoaded', function () {   
    var button = document.getElementById('slide');
    button.onclick = function () {
        document.getElementById('container').scrollLeft += 20;
    };
}, false);