鍍金池/ 問答/ HTML問答
耍太極 回答

簡單寫了個方法:

resetTree (oldTree) {
            let newTree = oldTree.map(item => {
                if (item.children) {
                    return {
                        ...item,
                        title: item.name,
                        children: this.resetTree(item.children)
                    }
                } else {
                    return {
                        ...item,
                        title: item.name
                    }
                }
            })
            return newTree
        }
拽很帥 回答

這個是判斷dom是否在window上半部分

執(zhí)念 回答

done是回調(diào)函數(shù),意思是告訴調(diào)用你的人(passport)你已經(jīng)執(zhí)行完你要執(zhí)行的內(nèi)容了,讓它繼續(xù)跑它的邏輯。
一般是以done(err,data)的形式回調(diào)。

老梗 回答

用戶的唯一標(biāo)識 是openid或者uid 你這樣區(qū)分是對的。

賤人曾 回答
{
  "name": "xxxxxx",
  "version": "11111",
  "description": "xxxxxxx",
  "author": xxxxx",
  "private": true,
  "scripts": {
    "dev": "node server.js",
    "start": "node server.js",
    "build": "node build.js "
  },
  "dependencies": {
      
  },
  "devDependencies": {
    "webpack": "^2.6.1",
  }
}

生產(chǎn)環(huán)境和生成環(huán)境的區(qū)別在于,根據(jù)命令行的輸入打包不一樣的,如npm run dev或npm run build,開發(fā)包有提示,報(bào)錯,但是生產(chǎn)環(huán)境會把獲取壓縮的文件,減少文件大小,如果生產(chǎn)環(huán)境沒有,會默認(rèn)讀取開發(fā)環(huán)境的包

風(fēng)畔 回答

oplog只會記錄變化的部分,沒有選項(xiàng)可以選擇不同的模式。Change stream是基于oplog的,所以其實(shí)它也只能給到變化的部分。Full Document模式給你的是經(jīng)過查詢之后得到的大多數(shù)節(jié)點(diǎn)上提交過的這個文件的版本。如果有其他操作夾在更新和這次讀取之間,你得到的可能會是后一次更新之后的文檔。這點(diǎn)在文檔里有描述:Look Full Document for Update Operations

If there are one or more majority-committed operations that modified the updated document after the update operation but before the lookup, the full document returned may differ significantly from the document at the time of the update operation.

不知道你的具體場景是什么,知道具體場景可能還可以進(jìn)一步探討其他解決方案。

尤禮 回答

render: (text, record, index) => {}

文檔定義:

render 生成復(fù)雜數(shù)據(jù)的渲染函數(shù),參數(shù)分別為當(dāng)前行的值,當(dāng)前行數(shù)據(jù),行索引,@return里面可以設(shè)置表格行/列合并

復(fù)雜操作用render

網(wǎng)妓 回答

其實(shí)是我沒有import image.....

近義詞 回答

如果說你想要在瀏覽器端獲取這個真實(shí)地址,也就是重定向之后的那個url,好像沒什么辦法可以拿到,反正我想不到辦法可以取到location的值(瀏覽器端的情況下)。

首先你可以知道,這個接口返回的如果直接就是圖片文件的話,那很簡單,真實(shí)地址就是:http://tu.hanximeng.com/api.php

但是你請求這個接口,看一下http響應(yīng)的內(nèi)容就知道,這個接口返回了一個指向真實(shí)圖片地址的重定向。

0060lm7Tly1fus1o69ssoj30m20djaak.jpg

而瀏覽器對于302狀態(tài)碼會自動再發(fā)起一次請求去請求這個定義在響應(yīng)頭location字段里的url

所以,如果拋開瀏覽器這個環(huán)境去請求這個接口,就可以直接獲取響應(yīng)頭里的location值了,比如你用node啦、php啦等等后端語言去對這個接口發(fā)起一次http請求,就可以直接去獲取圖片真實(shí)地址了,因?yàn)槟J(rèn)它們不會像瀏覽器一樣直接強(qiáng)制重定向~

孤巷 回答
  1. netstat -ano|findstr 4000 查詢 4000 端口被占用的PID;
  2. 假設(shè)是 3015;
  3. taskkill /pid 3015
尐潴豬 回答

不需要使用:filtered-value

 <el-table-column v-for="game in gameList" :label="game.gameNameCn" :filtered-value="[game]">
    <template v-if="scope.row.gameList.some(item=>item.gameId ===scope.column.filteredValue[0].gameId)">

可以直接改為

 <el-table-column v-for="game in gameList" :label="game.gameNameCn">
    <template v-if="scope.row.gameList.some(item=>item.gameId === game.gameId)">

使用:filtered-value屬性解決了我的問題

<el-table-column v-for="game in gameList" :label="game.gameNameCn" :filtered-value="[game]">
    <template v-if="scope.row.gameList.some(item=>item.gameId === scope.column.filteredValue[0].gameId)">
維他命 回答

直接執(zhí)行 npm link 即可,會自動注冊命令。

鹿惑 回答

先刪除電腦里C::Users{賬戶}下的.npmrc文件..
再重新跑一遍cnpm install -g vue-cli

夏木 回答

為了減少瀏覽器響應(yīng)時間,能不用圖片最好不用圖片,因?yàn)閳D片文件也是需要請求的,減少瀏覽器響應(yīng)時間的一個優(yōu)化方案就是盡量減少http請求,這也是為什么很多網(wǎng)站都使用雪碧圖來把必須使用的圖片放在一張圖片的原因。

笨小蛋 回答

如果是服務(wù)端渲染的項(xiàng)目,則所有的內(nèi)容都會打包到war或者jar包內(nèi),如果是war則放置在tomcat的webapp文件中,tomcat會自動進(jìn)行解壓,如果是jar,比如springboot打包成jar,則直接java -jar xxx.jar即可啟動項(xiàng)目。

凹凸曼 回答

你這樣的話,你的請求放在beforeRouteEnter鉤子中,在進(jìn)入路由之前獲取數(shù)據(jù)。

笨尐豬 回答

我只能說不建議用中文路徑,當(dāng)然如果目前為止沒出什么問題用用也無妨。

墨染殤 回答

寫英文 'microsoft yahei' 試試