JS中toFixed的坑

2023/05/12

小米路由3G刷老毛子

准备:

  • 小米路由3G
  • Windows或Mac电脑网线连接路由
  • U盘(FAT/FAT32格式)

注:

使用网线连接路由后进行操作
不保证内容的正确性,不承担带来的风险和后果

Read more   2023/05/12

brew修改为中科大源

$ cd "$(brew --repo)"
$ git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
$ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
$ git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
$ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-cask"
$ git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git

$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
$ source ~/.bash_profile
2023/05/12

安卓 position: absolute; position: fixed;和键盘冲突的问题

解决方式一

修改为relative或static

解决方式二

设置absolute时固定父元素高度(px)

解决方式三

弹出键盘时隐藏内容

@media (max-height: 500px) {
    .class {
        display: none;
    }
}
2023/05/12

yarn puppeteer错误

error /app/node_modules/puppeteer: Command failed.
Exit code: 1
Command: node install.js
Arguments:
Directory: /app/node_modules/puppeteer
Output:
ERROR: Failed to download Chromium r579032! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.
{ Error: connect ETIMEDOUT 216.58.221.240:443
at Object._errnoException (util.js:992:11)
at _exceptionWithHostPort (util.js:1014:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1186:14)
code: 'ETIMEDOUT',
errno: 'ETIMEDOUT',
syscall: 'connect',

解决办法:

export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true && yarn install

2023/05/12

2023/05/12

element-ui + element-theme + vue-cli + postcss-px2rem

  • element-ui: 1.4.2
  • vue-cli: 2.8.2
// utils.j
exports.cssLoaders = function (options) {
    ...
    return {
        css: generateLoaders('postcss', {
            plugins() {
                return [require('postcss-px2rem')({ remUnit: 75 })]
            }
        }),
        ...
    }
}
// vue-loader.conf.js
module.exports = {
    ...
    postcss: [require('postcss-px2rem')({ remUnit: 75 })],
    ...
}
2023/05/12

微信JS分享iOS不回调success方法

添加一个setTimeout就好了

...
success: function(results) {
    setTimeout(function() {
        // some
    }, 500);
}
2023/05/12 posted in  Web前端

选中/取消iconfont所有图标

打开控制台,粘贴下面代码,回车


var ls = document.getElementsByClassName('icon-cover-freeze');
var mClick = function(index) {
    if (index == ls.length) return;
    ls[index].firstElementChild.click();
    setTimeout(() => {
        mClick(index + 1);
    }, 5);
};
mClick(0);

2023/05/12 posted in  Web前端