标签 xcx 下的文章

git - 创建分支 - 撤销提交

在本地新建一个分支: git branch v1.0.0
切换到你的新分支: git checkout v1.0.0
将新分支发布在github上: git push origin v1.0.0
在本地删除一个分支: git branch -d v1.0.0
在 git 远程端删除一个分支: git push origin :v1.0.0   (分支名前的冒号代表删除)
直接删除上次提交,使用reset命令: git reset --hard HEAD^   (HEAD是指向最新的提交,上一次提交是HEAD^,上上次是HEAD^^,也可以写成HEAD~2 ,依次类推。)

CSS - 一个div设置多个背景图

.index-product-main {
    box-shadow: #abc6fb 0 0 18px inset;/*内部阴影*/
    padding: 20px;
    border: 1px solid #abc6fb;
    border-radius: 3px;
    background-image:url("../img/index/product/left-top.png"),url("../img/index/product/right-top.png"),url("../img/index/product/left-bottom.png"),url("../img/index/product/right-bottom.png");
    background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
    background-position: left top, right top, left bottom, right bottom;
}

拓展

win10专业版激活方法

1.首先,我们先查看一下Win10正式专业版系统的激活状态:

点击桌面左下角的“Windows”按钮,从打开的扩展面板中依次点击“设置”-“更新和安全”,并切换到“激活”选项卡,在此就可以查看到当前系统的激活状态。

阅读全文

深拷贝

var test = {
    a:"ss",
    b:"dd",
    c:[
        {dd:"css",ee:"cdd"},
        {mm:"ff",nn:"ee"}
    ]
};
var test1 = JSON.parse(JSON.stringify(test));//拷贝数组
//
test1.c[0].dd="change"; //改变test1的c属性对象的d属性
console.log(test);  //不影响test
console.log(test1);//test1改变

JS - 微信移动端自带返回 - 判断

$(function () {
    function pushHistory(){
        var state = {
            title: "title",
            url: "#"
        };
        window.history.pushState(state, "title", "#");
    }
    pushHistory();
    window.addEventListener("popstate", function (e) {
        //TODO
    }, false);
});

webpack 热加载

npm install webpack-dev-server -g
npm install webpack-dev-server --save-dev