鍍金池/ 問答/ HTML問答
痞性 回答

把path轉(zhuǎn)換成版本號(hào)進(jìn)行對(duì)比排序

$a = [
    '1' => '0',
    '2' => '0',
    '3' => '0',
    '4' => '1',
    '5' => '1',
    '6' => '2',
    '7' => '1',
    '8' => '1',
    '9' => '2',
    '10' => '3',
    '11' => '3',
    '12' => '2',
    '13' => '1',
    '14' => '1,8',
    '15' => '1,8,14',
    '16' => '2,9',
    '17' => '1,8',
    '18' => '3,10',
    '19' => '3,11',
    '20' => '3,10,18',
    '21' => '1,8,14,15',
    '22' => '1,8,14',
];

$result = treeSort($a);
print_r($result);

function treeSort($arr)
{
    $list = [];
    foreach ($arr as $key => $item) {
        $version = $item == 0 ? $item : ('0.' . $item);
        $list[] = [$key, str_replace(',', '.', $version) . '.' . $key];
    }
    $mySort = function ($a, $b) {
        return version_compare($a[1], $b[1], 'ge');
    };
    usort($list, $mySort);
    $tree = [];
    foreach ($list as $item) {
        $tree[$item[0]] = $arr[$item[0]];
    }
    return $tree;
}
墨染殤 回答

1、復(fù)制鏈接???

2、是否是同一url 相同url微信內(nèi)不刷新

女流氓 回答

你問區(qū)別的話,沒有太大的區(qū)別, 都是云服務(wù)器, 而且都是比較成熟的。
那些深層的、細(xì)微的區(qū)別, 中小企業(yè)以及普通用戶是接觸不到的

安若晴 回答

關(guān)于web的一切標(biāo)準(zhǔn)都可以MDN web docs上查找
https://developer.mozilla.org...
如果要看最新的東西一定要看英文頁(yè)面的(比如你問的兼容性現(xiàn)狀)

話寡 回答

直接用<hr/>標(biāo)簽即可。
然后設(shè)置一下css

hr {
  -moz-border-bottom-colors: none;
  -moz-border-image: none;
  -moz-border-left-colors: none;
  -moz-border-right-colors: none;
  -moz-border-top-colors: none;
  border-color: #EEEEEE -moz-use-text-color #FFFFFF;
  border-style: solid none;
  border-width: 1px 0;
  margin: 18px 0;
}

既然用Vue,就不要用jQuery了,你這個(gè)需求需要使用動(dòng)態(tài)模板(dynamic template),步驟這樣:

1 需要用vue的full版本(包括compiler),而不僅是runtime版本,在webpack配置中需要增加一個(gè)alias,類似

vue: 'vue/dist/vue.js'

2.然后在模板文件中,使用下面的方式來嵌入動(dòng)態(tài)模板

<component :is="dynamicTemplate()" />

dynamicTemplate函數(shù)需要返回處理好的模板內(nèi)容,類似:

return Vue.compile('<div>' + dynamicContent +'</div>')

之所以再套一個(gè)div,是因?yàn)閂ue的模塊需要單根。如果在動(dòng)態(tài)模板內(nèi)容中依賴一些組件,這些組件需要提前注冊(cè)好,可以使用vue的全局模塊注冊(cè)。

失魂人 回答

bind是不可能bind

setInterval(() => {
    update.call(null, Math.random())
}, 1000)
念初 回答

filter: blur(0px);
改為
filter: none;
可以解決問題。

熊出沒 回答

將拿到的數(shù)據(jù)保存在data里面,再將data里面的數(shù)據(jù)拿出來渲染就ok了

    <template>
      <div>
        {{myData.name}} // 在此進(jìn)行渲染
      </div>
    </template>
    
    <script>
    export default {
      data () {
        return {
          myData: {
            name: ""
          }
        }
      },
      methods: {
        getData () {
          const getFromDb = {name: 1} // 假設(shè)查詢到的是一格對(duì)象
          this.myData = getFromDb // 將查詢到的數(shù)據(jù)保存在data里
        }
      }
    }
    </script>
神曲 回答

加上這個(gè)css呢:-webkit-print-color-adjust: exact;試試

久愛她 回答

element 里沒有提供這樣的組件,type 可以為year/month/date/week/ datetime/datetimerange/daterange
這些,你想要的效果應(yīng)該是type=daterange 這種效果的。
你可以用兩個(gè)周組件進(jìn)行組合可以達(dá)到你想要的效果

雨萌萌 回答
  1. await 后面必須是promise,尼的request第一個(gè)版本還是callback
  2. 第2個(gè)也是錯(cuò)的
function spider() {
    return new Promise((resolve,reject)=>{
        request(xxx,(e,r)=>{
            e?reject(e):resolve(r);
        });
    });
}

使用

try{
    await spider();
}catch(e){
    console.log(e);
}
單眼皮 回答

//解決第三方軟鍵盤喚起時(shí)底部input輸入框被遮擋問題

var bfscrolltop = document.body.scrollTop;//獲取軟鍵盤喚起前瀏覽器滾動(dòng)部分的高度
$("input.inputframe").focus(function(){//在這里‘input.inputframe’是我的底部輸入欄的輸入框,當(dāng)它獲取焦點(diǎn)時(shí)觸發(fā)事件
    interval = setInterval(function(){//設(shè)置一個(gè)計(jì)時(shí)器,時(shí)間設(shè)置與軟鍵盤彈出所需時(shí)間相近
    document.body.scrollTop = document.body.scrollHeight;//獲取焦點(diǎn)后將瀏覽器內(nèi)所有內(nèi)容高度賦給瀏覽器滾動(dòng)部分高度
    },100)
}).blur(function(){//設(shè)定輸入框失去焦點(diǎn)時(shí)的事件
    clearInterval(interval);//清除計(jì)時(shí)器
    document.body.scrollTop = bfscrolltop;將軟鍵盤喚起前的瀏覽器滾動(dòng)部分高度重新賦給改變后的高度
});

[看看這個(gè)] https://blog.csdn.net/github_...

我不懂 回答

你可以不實(shí)時(shí)監(jiān)控計(jì)算啊。你在input失去焦點(diǎn)事件的時(shí)候,對(duì)輸入的數(shù)據(jù)進(jìn)行一個(gè)過濾就行了。

念初 回答

官方不推薦使用事件委托。

Is event delegation necessary?

Well, delegation has two main advantages: one is practical - it saves you from having to add (and remove!!) those listeners individually. But Vue already does that for you.

The other one is performance / memory. But since every click listener in a v-vor loop would use the same callback, this is minimal unless you have hundreds or thousands of rows.

And finally, you can use delegation pretty easily by adding an @click listener to the <ul> element instead of the children. But then you have to resort to checks on the click target to evaluate which item in your data it might represent. So I would only use that if you truly find any performance problems without delegation.

影魅 回答

router.get('/hello/:name', async (ctx, next) => {

....
ctx.response.body = result //數(shù)據(jù)結(jié)果;

});

生性 回答

提取公共方法

$(".menu_her").click(function(){
    click("menu_her");
});

$(".menu_service").click(function(){
    click("menu_service");
});

function click(evt){
    $("."+evt).slideToggle();
  if($("."+evt).text().indexOf("right")==-1){
    $("."+evt+" .material-icons").text('chevron_right');
  }else{
    $("."+evt+" .material-icons").text('expand_more');
  }
};
尛曖昧 回答

先把node_modules文件夾刪除掉,然后重試