鍍金池/ 問答/ HTML問答
孤酒 回答
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <style>
    body {
      height: 100vh;
      margin: 0;
      padding: 0;
    }
    .header {
      height: 60px;
      background: #ffbf00;
    }
    .content {
      display: flex;
      height: calc(100% - 60px);
      background: #0c86ff;
    }
    .left {
      width: 300px;
      background: #00a854;
    }
    .right {
      width: calc(100% - 300px);
      background: red;
    }
  </style>
</head>
<body>
  <div class="header"></div>
  <div class="content">
    <div class="left"></div>
    <div class="right"></div>
  </div>
</body>
</html>

圖片描述

鐧簞噯 回答

antd的按需加載配置import就可以了。與CommonsChunkPlugin沒什么關(guān)系吧。

plugins: [
      'import',
      [
        {
          'libraryName': 'antd',
          'style': true
        },
        {
          'libraryName': 'antd-mobile',
          'style': true
        },
      ]
    ]
終相守 回答

為啥要用sdk呢?寫個簡單的curl請求不好么?

空白格 回答

你的意思應(yīng)該是這樣:

<script>
    function test () {
        alert('訪問到了')
    };
    
    // 模擬得到的函數(shù)名字符串
    var funName = 'test';
    
    // 執(zhí)行函數(shù)
    window[funName]();
</script>

created: 實(shí)例已經(jīng)創(chuàng)建完成之后被調(diào)用。在這一步,實(shí)例已完成以下的配置:數(shù)據(jù)觀測(data observer),屬性和方法的運(yùn)算, watch/event 事件回調(diào)。然而,掛載階段還沒開始,$el 屬性目前不可見。
mounted: el 被新創(chuàng)建的 vm.$el 替換,并掛載到實(shí)例上去之后調(diào)用該鉤子。
如果想根據(jù)數(shù)據(jù)來加載C的樣式,可以使用created鉤子函數(shù)。

臭榴蓮 回答

你可以在根目錄下建一個src的目錄專門作為開發(fā),然后構(gòu)建完成之后通過gulp將對應(yīng)的html和資源放到相關(guān)的目錄就行

艷骨 回答

加個倒計時,逐一遞減

壞脾滊 回答

你的域名沒有微信認(rèn)證,只有已經(jīng)通過微信認(rèn)證的賬號可以去除這個提示

命多硬 回答

你之前安裝失敗過,需要去清理下緩存文件及報錯文件。還有就是,這些依賴不要自定義裝到其他盤,你自定義安裝到其他盤,自己就得手動配置一些東西,所以容易出現(xiàn)一些問題。C盤不差那點(diǎn)空間,而且如果C和D用的是一塊硬盤的話,所謂的分區(qū)不過就是人為的劃分罷了,D盤東西多了,系統(tǒng)一樣卡。

陌如玉 回答

1、只清除登錄相關(guān)的store
2、不要清空store,而是用默認(rèn)值去覆蓋

脾氣硬 回答

這個提交工單,問騰訊的工程師即可

薄荷糖 回答

配置本身沒看出什么問題來。把報錯提示貼一下?

離殤 回答

只能把B和C加到同一組加載,但是又不用弄一個高度為0的容器裝C。

把組件按組分塊

入她眼 回答

MDN上有針對removeChild上可能造成的異常有解釋:

The method throws an exception in 2 different ways:

  • If the child was in fact a child of element and so existing on the
    DOM, but was removed the method throws the following exception:

??Uncaught NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.

  • If the child doesn't exist on the DOM of the page, the method throws
    the following exception:

Uncaught TypeError: Failed to execute 'removeChild' on 'Node': parameter 1 is not of type 'Node'.

If child was in fact a child of element at the time of the call, but was removed by an event handler invoked in the course of trying to remove the element (eg, blur.)

枕頭人 回答

看你這段代碼 無非需要改的地方 就是把$index 改變一下

v-for = "(item,index) in menu "

下面的 $index 替換為 index 就可以使用了

涼薄 回答

Vue數(shù)據(jù)響應(yīng)式的原理是 Object.defineProperty 用get和set劫持其他人對 對象屬性的訪問
然后vue自己寫的set里面,實(shí)現(xiàn)了(ˇ?ˇ) 想向所有需要這個屬性的對象,發(fā)送這個屬性最新的值
只要修改了 屬性的值 就會調(diào)用 set 方法,然后其他對象就知道數(shù)據(jù)改變,然后重新渲染

相關(guān)代碼

var a = {
    n: 12,
    m: 'asd'
}
Object.defineProperty(a, 'm', {
    get: function(){
        console.log('觸發(fā)了 getter');
        return 'asd';
    },
    set: function(value){
        console.log('觸發(fā)了 setter');
        m = value;
    }
});
法克魷 回答

感覺你說的好亂...不知道有沒有理解你的意思??梢栽诼酚芍性黾觤eta元信息來控制是否緩存($route.meta.keepAlive)。也可以在進(jìn)入或者離開列表頁的時候監(jiān)聽(watch)$route的變化,看from和to,來控制是否重新獲取數(shù)據(jù)。

夢若殤 回答

@nurdun

這樣寫,將2個本來異步的操作變成了同步: 先tet后data,我們需要一種更好的方法,讓tet和data異步執(zhí)行,promise.all接受2個異步的結(jié)果,無論是否正確返回,返回的數(shù)據(jù)都應(yīng)該保存在promise.all的結(jié)果數(shù)組中。

或許可以這么做:

toFetch(url){
    return fetch(url)
        .then(res=>res.json())
        .catch(err=>new Promise(resolve=>resolve(err)))

將err結(jié)果也封裝成resolve返回,這樣,所有返回都在promise.all中。

淺時光 回答
  1. 父元素的基線是字母x的底端。

  2. vertical-aglin:baseline是元素基線與父元素的基線對齊。vertical-aglin:middle是元素中垂線與父元素的基線加上小寫x一半的高度值對齊。所以不是父元素的基線變了,而是元素的對齊標(biāo)準(zhǔn)變了。


更新:
https://codepen.io/WhiteYin/p...
寫了個demo對比下兩種情況。
通過隱藏粉色div,你可以發(fā)現(xiàn)父元素basaline+1/2 x-height的位置一直是沒有變化的。
只不過粉紅div顯示后父元素高度會變高。