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

鍍金池/ 問答
怪痞 回答

或許你可以調(diào)整一下思路:不在用戶輸入時處理,而是在展示時才處理內(nèi)容。

你之前的思路: 用戶點(diǎn)擊表情,又是判斷輸入框里之前的內(nèi)容,又是存儲表情,等等。

其實(shí)這些都不用,我們換成這樣的思路:先不管用戶如何輸入,他怎么輸入,輸入框就怎樣展示,比如他輸入兩個表情與一個文本,那么輸入框的內(nèi)容是[微笑]123[撇嘴],等到用戶點(diǎn)擊發(fā)送按鈕要把內(nèi)容展示到聊天框里時,再把[微笑]和[撇嘴]轉(zhuǎn)換為表情。

提供一個簡單的代碼:

// 存儲所有表情,方便轉(zhuǎn)換
/*
emj_arry = {
  [冷汗] : {
    text: "冷汗",
    url: "http://pub.idqqimg.com/lib/qqface/17.gif"
  },
  [發(fā)呆] : {
    text: "發(fā)呆",
    url: "http://pub.idqqimg.com/lib/qqface/3.gif"
  }
}
*/
var emj_arry = {}; //表情列表
var emj_i = document.getElementsByTagName('i');
for(var i=0, len=emj_i.length; i<len; i++){
  var item = emj_i[i];
  // emj_arry.push( '[' + item.title + ']' );
  emj_arry[ '[' + item.title + ']'  ] = {
    text : item.title,
    url : 'http://pub.idqqimg.com/lib/qqface/' + i + '.gif'
  };
}

// 將文字轉(zhuǎn)換為圖片
function emoj2img(text){
  return text.replace(/\[(.*?)\]/g, function(word){
    return '<img src="'+emj_arry[word].url+'" alt="'+word+'" />';
  })
}

// 輸入表情
document.querySelector('#div_ul').addEventListener('click', function(event){
  if(event.target.tagName=='I' && event.target.title!=='delKey'){
    send_txt.value = send_txt.value + '[' + event.target.title + ']';
  }
});

// 點(diǎn)擊按鈕發(fā)送
document.querySelector('button').addEventListener('click', function(){
  var textarea = document.querySelector('#send textarea'),
      value = textarea.value;
  
  document.querySelector('#div_1').innerHTML += '<p>'+emoj2img(value)+'</p>'; // 把表情轉(zhuǎn)換為圖片后輸出
  textarea.value = '';
});

webstorm:
1.設(shè)置里Editor=>Code Style=>Live Templates自己按需求設(shè)置,for(itar),for..of(iter),for..in(itin)已經(jīng)自帶了,直接簡寫+TAB就好了
2.自動文檔啥意思,自動跳轉(zhuǎn)文檔嗎,ctrl+q 有些帶上箭頭的可以跳轉(zhuǎn)外部網(wǎng)站

vscode:
1.命令I(lǐng)nsert Snippet,選擇需要的,自定義在首選項(xiàng)=>用戶代碼片段里
2.沒用過

眼雜 回答

<div class="main">
<div class="main-back"></div>
<div class="mian-content">5555</div>
</div>
.main{
width:200px;
height:200px;
position:relative;

}

.main-back,
.mian-content{
width:100%;
height:100%;
position:absalute;
}
.main-back{
display:none;
z-index:1;
background:red;
}
.mian-content{

z-index:2;

}
.main:hover .main-back{
display:block
}

不二心 回答

原來我連題意都沒有理解,都沒有弄清最長回文子序列是啥

司令 回答

func (d data)test(s string){

d.Lock()
defer d.Unlock()
for i:=0;i<5 ;i++ {

println(s,i)
//time.Sleep(time.Second)

}
}
指針的問題,(d data)相當(dāng)于復(fù)制了多個鎖給協(xié)程用,(d *data)就變成一個鎖,就沒問題了

影魅 回答

隨時 保存表單數(shù)據(jù)
頁面初始化時 填入
不就完了

瘋子范 回答

template換成div等標(biāo)簽,可以鼠標(biāo)hover到報(bào)錯的地方,會顯示錯誤信息哦

溫衫 回答

安裝Xcode,會帶有clang++工具,或者嘗試下brew install clang++

更新--------------------------------------------------------------
試下
brew install homebrew/php/php56-sphinx 安裝php擴(kuò)展,會自動安裝擴(kuò)展依賴

孤客 回答

你是想監(jiān)聽input value 為空呢?

鹿惑 回答

【19:47更新】問題解決

我在本地服務(wù)器,把測試接口改為線上服務(wù)器的接口。發(fā)現(xiàn)上傳后等待的時間很短。
而且我手動打開線上服務(wù)器的PHP接口速度也很快。
因此,否決了“PHP出問題”的想法。

然后我回頭看Nginx的配置,把IP地址改為127.0.0.1.
圖片描述
配置線上服務(wù)器,再次嘗試上傳大文件。
圖片描述

雖說還是有些Waiting的時間,但基本可以忽略。
有關(guān)這個Bug的更多解決方案可以百度【W(wǎng)aiting (TTFB) nginx】這個關(guān)鍵字。

相信還有優(yōu)化的空間(CDN等)。

這個困擾我一天半的Bug終于解決了。
最后非常感謝 @xialeistudio 這位朋友的回答。雖說最終沒有通過php-fpm的日志發(fā)現(xiàn)問題的原因。
但您的回答對我很有幫助,加深了對PHP的理解。謝謝!

夢一場 回答

parse相關(guān)函數(shù), 處理url parse_url(), 處理?后面帶的數(shù)據(jù) parse_str()


$url        = 'http://www.abc.com/?title=ww&imgFile=%2Fpublic%2Fupload%2Fimage%2F20180712%2F20180712024544_27715.jpg';
$urlArray   = parse_url($url);
print_r($urlArray);
parse_str($urlArray['query'], $paramList);
print_r($paramList);
exit;

結(jié)果

Array
(
    [scheme] => http
    [host] => www.abc.com
    [path] => /
    [query] => title=ww&imgFile=%2Fpublic%2Fupload%2Fimage%2F20180712%2F20180712024544_27715.jpg
)
Array
(
    [title] => ww
    [imgFile] => /public/upload/image/20180712/20180712024544_27715.jpg
)
大濕胸 回答

之前回答別人的問題,Vue 全選 單選問題

既然用Vue了就操作數(shù)據(jù),盡量不操作DOM
寫了個小demo Vue 全選單選問題,右擊查看源碼,可供參考。
<template>
    <div id="app">
        <a  target="_blank">SF上的Vue 全選 單選問題</a>
        <ul>
            <li class="checked-item" @click="singleSelect(row, index)" v-for="(row, index) in goods">
                <input type="checkbox" :checked="row.checked"/>{{row.name}}
            </li>
        </ul>
        <div>
            <span @click="allSelect">
                <input type="checkbox" :checked="isAllSelected"/>
                <button>全選</button>
            </span>
            <span class="checked-count" v-if="checkedGoodIds.length > 0">已選擇:{{checkedGoodIds.length}}項(xiàng)</span>
        </div>
    </div>
</template>
<script>
    new Vue({
        data: {
            goods: [{
                id: 1,
                name: '選項(xiàng)1-xuanyuan1',
                checked: false
            }, {
                id: 2,
                name: '選項(xiàng)2-xuanyuan2',
                checked: false
            }, {
                id: 3,
                name: '選項(xiàng)3-xuanyuan3',
                checked: false
            }, {
                id: 4,
                name: '選項(xiàng)4-xuanyuan4',
                checked: false
            }, {
                id: 5,
                name: '選項(xiàng)5-xuanyuan5',
                checked: false
            }, {
                id: 6,
                name: '選項(xiàng)6-xuanyuan6',
                checked: false
            }],
        },
        computed:{
            // 是否全選
            isAllSelected(){
                return this.goods.every((el) => {
                    return el.checked;
                })
            },
            // 選中商品的id
            checkedGoodIds(){
                let filterArr = this.goods.filter((el) => {
                    return el.checked;
                });
                return filterArr.map((el) => {
                    return el.id;
                })
            }
        },
        methods: {
            // 全選、全不選
            allSelect() {
                let checked = true;
                // 全選
                if(this.isAllSelected){
                    checked = false;
                }
                this.goods = this.goods.map(el => {
                    el.checked = checked;
                    return el;
                })
            },
            // 單選
            singleSelect(row, index) {
                row.checked = !row.checked;
                this.goods.splice(index, 1, row);
            }
        }
    }).$mount('#app')
</script>
茍活 回答

setState會觸發(fā)子組件的重新計(jì)算vdom,但是不一定會重新更新dom

你可以先暫存自己的代碼
git stash
git pull origin master
git stash pop

祈歡 回答
  • 通過反射可以知道入?yún)⒌降资莻€什么Kind。
  • 結(jié)構(gòu)體指針和結(jié)構(gòu)體,對Marshal函數(shù)來說也沒什么區(qū)別,Elem函數(shù)可以通過結(jié)構(gòu)體指針訪問到指針指向的結(jié)構(gòu)體Value。
安若晴 回答

js沒有這個內(nèi)置函數(shù)的。你不需要額外去轉(zhuǎn)換,js會自己處理成 12e+7 類似這種科學(xué)計(jì)數(shù)法的數(shù)字

初念 回答

終于解決了,mount的問題,具體我也不清楚,把/etc/fstab 相應(yīng)的option改為rw,suid,dev,auto,user,async,exec就好了

執(zhí)念 回答

CSS:before and after