鍍金池/ 問答/ HTML問答
呆萌傻 回答
setTimeout(()=>console.log('token will be expiried in 5 mins'), new Date(Date.parse("Tue Nov 21 2017 00:40:59 GMT +0800 (CST)"))-Date.now()-5*60*1000)
硬扛 回答
  1. 先檢查node版本是否符合你安裝的vue-cli的版本最低要求
  2. 如果第一條沒有解決,就升級(jí)你的vue-cli,升級(jí)方式npm i vue-cli -g
傻叼 回答
  1. fn返回的是一個(gè)數(shù)組,所以結(jié)果肯定是一個(gè)多維數(shù)組
  2. concat只能接受數(shù)組作為參數(shù),"..."運(yùn)算之后就不是數(shù)組了。
const flatten = (arr, depth = 1) =>
 arr.reduce((a, v) => a.concat(depth > 1 && Array.isArray(v) ? flatten(v, depth - 1) : v), > []);

來源:flatten

女流氓 回答

this.keys["similar"] = similar;
this.keys["relative"] = relative;

  1. 為什么第一處typeof是"undefined"?
    obj是個(gè)實(shí)例對(duì)象,默認(rèn)沒有prototype
  2. 為什么第二處的prototype是object?
    第二處你用的是一個(gè)funtion,function默認(rèn)有prototype,并且默認(rèn)其下只有一個(gè)constructor屬性指向自己。
  3. 為什么最后一處是false?
    Object.create創(chuàng)建了一個(gè)新的object,具體實(shí)現(xiàn)方式類似于下面

      Object.create =  function (o) {
          var F = function () {};
          F.prototype = o;
          return new F();
      };
淚染裳 回答
const reducer = (state = {}, action) => {
    switch (action.type) {
        case 'chinese':
            return {
                ...state,
                ...{msg: '這是Redux啊'}
            }
        case 'english':
            return {
                ...state,
                ...{msg: "This is Redux"}
            }
        default:
            return state
    }
}

改成這樣

舊酒館 回答

"css-loader",
"postcss-loader",

改為:

{loader: 'css-loader',options: { importLoaders: 1 }},
{loader: 'postcss-loader',options: { config: { path: path.resolve(__dirname, './postcss.config.js') } },

我是在這里找到的答案:
https://github.com/webpack-co...

你好胸 回答

Web App側(cè)重“功能”,是使用網(wǎng)頁技術(shù)實(shí)現(xiàn)的App??偟膩碚f,Web App就是運(yùn)行于網(wǎng)絡(luò)和標(biāo)準(zhǔn)瀏覽器上,基于網(wǎng)頁技術(shù)開發(fā)實(shí)現(xiàn)特定功能的應(yīng)用。比如谷歌搜索引擎就是一個(gè)webApp,它有一個(gè)特定的功能,所以可以稱為webapp
https://baike.baidu.com/item/...

PWA可以添加至主屏幕,點(diǎn)擊主屏幕圖標(biāo)可以實(shí)現(xiàn)啟動(dòng)動(dòng)畫以及隱藏地址欄,實(shí)現(xiàn)離線緩存功能,即使用戶手機(jī)沒有網(wǎng)絡(luò),依然可以使用一些離線功能,實(shí)現(xiàn)了消息推送。
https://segmentfault.com/a/11...

執(zhí)念 回答

CSS:before and after

薔薇花 回答
export class HeaderComponent implements OnInit {
    private timer = 0;
    public settingDialog = false;
    
    ...
    toggleSetting(isShow: any) {
        const show = !!isShow;
        clearTimeout(this.timer);
        if (!show) {
            // delay 600ms for hide
            this.timer = setTimeout(() => {
                this.settingDialog = show;
            }, 600);
            return;
        }
        this.settingDialog = show;
    }
    ...
}
巷尾 回答

tp5的多文件不是指這個(gè) <input name="file" type="file" multiple/> .
是指
<input type="file" name="file[]" />

<input type="file" name="file[]" />

<input type="file" name="file[]" />

離夢 回答

自己找到了解決方案…………………………
這樣配置后可以直接本地請(qǐng)求線上地址,不會(huì)出現(xiàn)跨域問題。

解決方案:
跨域問題
1本地host配置成線上域名:
要注意的是localhost不支持端口映射,之前就是栽進(jìn)這個(gè)坑里了。
clipboard.png
2.設(shè)置axios請(qǐng)求攔截器(可不設(shè)置)

clipboard.png
ip限制問題
ip限制的話就是通過vpn代理本地請(qǐng)求了,比如他限制40.70.230.110:3499這個(gè)訪問,就需要把服務(wù)器配置成這個(gè)40.70.230.110:3499。自己百度吧。
3.本地訪問的時(shí)候直接訪問m.xx.com

膽怯 回答

其實(shí)使用GraphQL不一定要和Node綁定的,主流的語言和開發(fā)框架都有GraphQL的擴(kuò)展。所以不妨把問題的關(guān)注點(diǎn)放在要不要應(yīng)用GraphQL。

懶豬 回答

https://www.microsoft.com/net...
這里有3.5,但是也沒有4.0

要兼容XP確實(shí)挺慘的,還是想辦法升級(jí)到至少WIN7吧。

使用聚合查詢

db.projects.aggregate([{
    $lookup:{
        from:'users',
        localField: 'userId',
        foreignField: '_id',
        as: 'userinfo'
        }
},{
    $match:{
        'userinfo.sex': '0'
}},{"$unwind": "$remark"}])