在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/ HTML問答
夕顏 回答

//用onLoad周期方法重新加載,實(shí)現(xiàn)當(dāng)前頁(yè)面的刷新
this.onLoad()

詆毀你 回答

[HMR] Waiting for update signal from WDS... (瀏覽器的控制臺(tái)時(shí)常蹦出來(lái)的提示)
針對(duì) “[HMR] Waiting for update signal from WDS...” 翻譯下:來(lái)自 WDS 的提示,正在等待更新。
1、webpack 是什么:
webpack是一個(gè)自動(dòng)化構(gòu)建工具,意在幫前端開發(fā)者解決除了業(yè)務(wù)開發(fā)外的雜事,比如:打包、語(yǔ)言的轉(zhuǎn)換、熱更新、啟本地服務(wù)器等等。與本問題相關(guān)的webpack配置是它為我們搭建的本地服務(wù)器以及熱更新功能。
2、[HMR] 是什么:
它是 Hot Module Replacement 的簡(jiǎn)寫。翻譯過(guò)來(lái):模塊熱更新。所以HDR開頭的信息提示由webpack/hot/dev-server模塊產(chǎn)生
3、[WDS] 是什么:
它是 Webpack dev Server 的簡(jiǎn)寫。翻譯過(guò)來(lái):webpack的開發(fā)環(huán)境服務(wù)器(本地服務(wù)器)。所以WDS開頭的信息提示由 webpack-dev-server本地服務(wù)器產(chǎn)生
來(lái)自https://www.jianshu.com/p/330...

不能,改的話也只是改的瀏覽器緩存的頁(yè)面html/css等文件

旖襯 回答

為什么不直接vue.$data.content = res.d,根據(jù)res.d來(lái)渲染呢?

陌璃 回答

https://stackoverflow.com/que...
你需要?jiǎng)?chuàng)建一個(gè)http server

var express = require('express')
var expressWs = require('express-ws')

var app = express()
expressWs(app)

app.ws('/echo', (ws, req) => {

    ws.on('connection', function (connection) {
        //...
    })

    ws.on('close', function () {
        //...
    })
})

app.use(express.static('public'))
app.listen(3000, function () {
    console.log('Example app listening on port 3000!')
})
陌顏 回答

4000次的循環(huán)本身并不大,如果循環(huán)里僅僅是對(duì)內(nèi)存的操作其實(shí)很快就應(yīng)該完成,但是你在循環(huán)里做了很多次數(shù)據(jù)庫(kù)操作,這應(yīng)該就是造成性能問題的根本原因。盡管每條sql執(zhí)行都很快,但是你忽略了每次執(zhí)行所帶來(lái)的網(wǎng)絡(luò)io開銷時(shí)間。我才想4000次的循環(huán)里如此多的數(shù)據(jù)庫(kù)操作足以是你的腳本超時(shí)了,當(dāng)你所提到超時(shí)時(shí),我認(rèn)為你的php運(yùn)行在fast cgi模式下。那么你有兩種方法來(lái)解決
1,將sql操作合并,一次或幾次在循環(huán)之外一口氣得到所有的數(shù)據(jù),再在循環(huán)中進(jìn)行分門別類。我相信這樣做會(huì)立竿見影的提升效率。
2, 如果這個(gè)操作不是及時(shí)性的,那么可以嘗試放在cli模式下運(yùn)行,你不用修改代碼,盡管效率同樣低,但cli模式下腳本不會(huì)超時(shí)。

另外如果你所獲得到數(shù)據(jù)總量很大,那么還要考慮php本身為腳本所分配的最大可用內(nèi)存,如果這個(gè)值低于你獲取的數(shù)據(jù)所需要的內(nèi)存,那么即便在cli模式腳本還是得崩。這個(gè)配置好像是在php.ini里一個(gè)叫max_memory_size定義的,名字可能不準(zhǔn)確,我記不太清了

解夏 回答

不完全是

父組件給子組件傳遞的屬性,更像是把父組件的屬性賦值給子組件,類似于:

let childProp = parentProp

因此,如果父組件屬性是個(gè)對(duì)象的話,那就是傳遞的引用,否則傳遞的是值的拷貝

壞脾滊 回答

如果是前端生成:

var html += '<div class="form-group well" id="23"> +
            '<div class="row">' +
            // ...
            '</div>';
            
document.getElementById('id').innerHTML = html;
如果覺得拼字符串麻煩,不妨嘗試下模板引擎,或者試試vue、react啥的。

如果是后端返回的html片段:

$('#id').load('/api/xxx');
我不懂 回答

hover之后將該區(qū)域塊顯示出來(lái),然后加上animation,從左到右的滑動(dòng)
舉個(gè)例子

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
  <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
  <style>
    ul li{list-style:none; width:100px; position:relative; float:left; overflow:hidden;}
    ul li img{width:100%;}
    ul li .info{position:absolute; bottom:0; left:0; width:100%; height:40px; line-height:40px; background:-webkit-gradient(linear, 0 0, 0 bottom, from(rgba(255,255,255,.2)), to(rgba(0,0,0,.2)));}
    .hide{display:none;}
    .slideleft{animation:left .5s 1; animation-fill-mode:forwards;}
    .slideright{animation:right .5s 1; animation-fill-mode:forwards;}
    .slidetop{animation:top .5s 1; animation-fill-mode:forwards;}
    .slidebottom{animation:bottom .5s 1; animation-fill-mode:forwards;}
    
    @keyframes left{
      from{left:-100%;}
      to{left:0;}
    }
    @keyframes top{
      from{bottom:-100%; left:0;}
      to{bottom:0; left:0;}
    }
    @keyframes bottom{
      from{bottom:100%;}
      to{bottom:0;}
    }
    @keyframes right{
      from{left:100%;}
      to{left:0;}
    }
  </style>
</head>
<body>
  <ul>
    <li>
      <img src="https://img1.epetbar.com/2017-05/24/10/7982bafb75e8aba985e08de99780be52.jpg?x-oss-process=style/fill&$1=300&$2=300" alt="">
      <div class="info hide">
        test
      </div>
    </li>
    <li>
      <img src="https://img1.epetbar.com/2017-05/24/10/7982bafb75e8aba985e08de99780be52.jpg?x-oss-process=style/fill&$1=300&$2=300" alt="">
      <div class="info hide">
        test
      </div>
    </li>
    <li>
      <img src="https://img1.epetbar.com/2017-05/24/10/7982bafb75e8aba985e08de99780be52.jpg?x-oss-process=style/fill&$1=300&$2=300" alt="">
      <div class="info hide">
        test
      </div>
    </li>
  </ul>

<script>
$("li").hover(function(e){
  var mX = e.clientX;
  var mY = e.clientY;
  var liLeft = $(this).offset().left;
  var liTop = $(this).offset().top;
  var liW = $(this).width();
  var liH = $(this).height();

  x = (mX - liLeft - ( liW  / 2 ) ) * ( liW  > liH ? (liH / liW ) : 1 )
  y = (mY - liTop - (liH / 2)) * (liH > liW ? (liW / liH) : 1),  
  // 上(0) 右(1) 下(2) 左(3)  
  direction = Math.round( ( ( ( Math.atan2( y, x ) * ( 180 / Math.PI ) ) + 180 ) / 90) + 3 ) % 4;
  if(direction == 0){
    $(this).find(".info").removeClass("hide").addClass("slidetop");
  }else if(direction == 1){
    $(this).find(".info").removeClass("hide").addClass("slideright");
  }else if(direction == 2){
    $(this).find(".info").removeClass("hide").addClass("slidebottom");
  }else if(direction == 3){
    $(this).find(".info").removeClass("hide").addClass("slideleft");
  }
},function(){
  $(this).find(".info").addClass("hide").removeClass("slideleft").removeClass("slidetop").removeClass("slideright").removeClass("slidebottom")
})
</script>
</body>
</html>
久不遇 回答

你是個(gè)人才啊

悶油瓶 回答

userath()這個(gè)函數(shù)是沒有返回值的
響應(yīng)的話 ctx.body=response

mongoose支持promise,配合await使用

try{
    var user = awiat userModel.find({name: ctx.request.body.username});
    if(user.length == 0){
        ctx.body = "user not register"
    } else {
        let user = await userModel.find({
            name: ctx.request.body.username,
            password: ctx.request.body.password
            });
        if (user == null || user.length == 0) {
            console.log(user);
            console.log('password wrong');
            ctx.body = "login fail";
         
        }
        if (user != null && user.length > 0) {
            console.log('login sccessful');
            ctx.body = "login successful";
        }
    }
} catch(e){
}


萌小萌 回答

file:///訪問模式換成http://xxxxxx

青檸 回答

2個(gè)div利用css3旋轉(zhuǎn) body超出內(nèi)容部分隱藏 就OK了

玄鳥 回答

答案是type不同了。

React.createElement的函數(shù)簽名是 React.createElement(type, props, children)

React在做dom diff時(shí)候,首先判斷的就是type,如果type不一致就會(huì)重新渲染(remove然后append)。

題主currentItem.isLeaf 變化時(shí),對(duì)應(yīng)的正好就是type發(fā)生變化,因此會(huì)重新渲染。

故人嘆 回答
ajax的open開啟的是什么連接,是TCP連接還是HTTP連接

ajax請(qǐng)求的連接,既是TCP也是HTTP連接,因?yàn)镠TTP是應(yīng)用層的連接,傳輸層用的是TCP

ajax的連接有長(zhǎng)連接和短連接之分嗎?

多數(shù)Web服務(wù)器軟件都是用HTTP/1.1協(xié)議, 你十有八九不用設(shè)置已經(jīng)以用Connection: keep-alive了. 這取決于服務(wù)器端的配置.

熊出沒 回答

assetsSubDirectory,你應(yīng)該再改一下這個(gè)字段。

補(bǔ)充:

// utils.js
exports.assetsPath = function (_path) {
  const assetsSubDirectory = process.env.NODE_ENV === 'production'
    ? config.build.assetsSubDirectory
    : config.dev.assetsSubDirectory
  return path.posix.join(assetsSubDirectory, _path)
}

// webpack.base.conf.js
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url-loader',
options: {
  limit: 10000,
  name: utils.assetsPath('img/[name].[hash:7].[ext]')
}

lz看一下utils的assetsPath方法和webpack.base.conf.js中有關(guān)圖片類型的loader處理路徑,這樣大概就能夠明白最終編譯的static/img是怎么來(lái)的了。

胭脂淚 回答

layer.load() 沒關(guān)掉呀

var index = layer.load()
layer.close(index)  // 這樣才能關(guān)閉 load 層,否則會(huì)一直 load
焚音 回答

性能沒太大影響,如果頁(yè)面需要搜索引擎收錄的好這樣不行,爬蟲爬取的頁(yè)面不執(zhí)行js,如果不需要搜索引擎收錄,這種ajax請(qǐng)求之后,數(shù)據(jù)渲染用戶體驗(yàn)度還是不錯(cuò)的