鍍金池/ 問(wèn)答/ HTML問(wèn)答
陌璃 回答

我的理解是timed out屬于被動(dòng)關(guān)閉,服務(wù)器不響應(yīng)也不理你,socket closed屬于主動(dòng)關(guān)閉,服務(wù)器直接就拒絕了。mongoose監(jiān)聽(tīng)timedoutclose(had_error)只是為了區(qū)分錯(cuò)誤類型,最終都執(zhí)行了socket.end()。

尐懶貓 回答

目前無(wú)解
去 Echarts github 提個(gè)issue吧

背叛者 回答

我看你的demo,藍(lán)色的邊框應(yīng)該是outline吧。
設(shè)置

button{
    outline:none;
}

試試。

抱歉,我看錯(cuò)問(wèn)題了,剛看到你說(shuō)的是藍(lán)色背景。
試試下面的代碼去除高亮。

-webkit-tap-highlight-color:rgba(0,0,0,0);
孤酒 回答

先把幾千種可能性放到數(shù)組里
再shift 得出概率可控
時(shí)間復(fù)雜度o(0)

__

多次隨機(jī)必會(huì)壓縮解空間
t1大神專門說(shuō)過(guò)

心夠野 回答

你用了getFieldDecorator以后Input組件的修改數(shù)據(jù)會(huì)被Form托管,你的onChange會(huì)被Form的方法覆蓋,你看下antd的文檔


額onChange不會(huì)被覆蓋 是我想錯(cuò)了 剛寫了個(gè)demo測(cè)了下 不會(huì)出現(xiàn)不能更新input值的情況 我看你的Input是個(gè)自己的組件 你的onChange方法是怎么實(shí)現(xiàn)的?有沒(méi)有獲取到Form通過(guò)props傳給你的更新后重新調(diào)用this.props.onChange?

不舍棄 回答

去掉size中的{}和kb就可以了,即:
<input type="file name="brandLogo" id="brandLogo" class="hidden" @change="getFileName"
v-validate="'required|image|ext:[gif,jpeg,jpg,bmp,png]|size:300'"/>

安淺陌 回答

b頁(yè)面確認(rèn)之后 返回 用 navigateBack 別用to,因?yàn)?你B頁(yè)面返回a頁(yè)面,b已經(jīng)沒(méi)用了. 用to,b頁(yè)面就還在內(nèi)存里面. 用back 就銷毀b頁(yè)面了. 而小程序是限制了最大深度的.所以你跳轉(zhuǎn)到一定次數(shù)就無(wú)效了.

毀與悔 回答

https://router.vuejs.org/zh-c...

多看文檔,你遇到的問(wèn)題基本上官方都有解決方案了

乞許 回答

提示說(shuō)的很清楚,沒(méi)有這個(gè)方法,就自己寫一個(gè)這個(gè)方法。

def create_node(tag, property_map, content):  
    '''''新造一個(gè)節(jié)點(diǎn) 
       tag:節(jié)點(diǎn)標(biāo)簽 
       property_map:屬性及屬性值map 
       content: 節(jié)點(diǎn)閉合標(biāo)簽里的文本內(nèi)容 
       return 新節(jié)點(diǎn)'''  
    element = Element(tag, property_map)  
    element.text = content  
    return element 
    
    

需要增加節(jié)點(diǎn)的地方調(diào)用一下這個(gè)函數(shù)就可以了。

旖襯 回答

交錢給騰訊唄,我聽(tīng)說(shuō)有一種強(qiáng)制推廣貌似能發(fā)送消息給一定范圍內(nèi)的用戶,但我重來(lái)沒(méi)遇到過(guò)。還有,老鐵,虛擬紅包是什么玩意?是不是就是騙人發(fā)個(gè)假紅包

爛人 回答

估計(jì)是虛擬機(jī)內(nèi)存不足,換一臺(tái)解決了,務(wù)必保證最低系統(tǒng)配置要求;

青裙 回答

document.addEventListener("DOMContentLoaded", function(event) {

  console.log("DOM fully loaded and parsed");

});
詳情參見(jiàn)
https://developer.mozilla.org...

乖乖噠 回答
  1. 不合理。用戶登錄成功以后應(yīng)該在本地保存一份用戶數(shù)據(jù),注意我說(shuō)的是保存到本地不是保存到localstorage,因?yàn)楸4姹镜氐姆椒ㄓ泻芏喾N,比如cookieindexedDB等,所以,代碼中不應(yīng)該直接調(diào)用window.localStorage,而是應(yīng)該封裝一個(gè)用戶數(shù)據(jù)的讀取類,解除代碼耦合,將來(lái)要改成其他存儲(chǔ)方式比較簡(jiǎn)單:

    const USER_INFO='USER_INFO'
    function getUserinfo(){}
    function setUserinfo(){}
  2. 不應(yīng)該。個(gè)人認(rèn)為不應(yīng)該,getters語(yǔ)義上就是獲取數(shù)據(jù),但是卻改變了數(shù)據(jù),導(dǎo)致不純凈,可能會(huì)埋下維護(hù)上的隱患。

  3. 是的。理論上應(yīng)該有一個(gè)接口用來(lái)更新用戶狀態(tài),比如判斷用戶是否需要重新登錄之類的,比如api/refresh, 所以邏輯應(yīng)該是:

    • 用戶進(jìn)入app,判斷本地是否有用戶信息。

      • 有,調(diào)用api/refresh,判斷是否需要重新登錄。

        • 不需要(連續(xù)登錄),將信息保存在vuex中,并進(jìn)入首頁(yè),往后數(shù)據(jù)讀取全部走vuex。

        • 需要(長(zhǎng)時(shí)間未登錄),刪除本地用戶信息并跳轉(zhuǎn)到登錄流程。

      • 沒(méi)有, 跳轉(zhuǎn)到登錄流程(以下是登錄流程)。

        • 調(diào)用api/login登錄。

        • 將保存到本地,并保存到vuex中,往后數(shù)據(jù)讀取全部走vuex。

  4. 看3,具體還可以看看jwt,或者基于tokenapi設(shè)計(jì)相關(guān)的文章。

寫榮 回答

jest.timeout設(shè)置一個(gè)更長(zhǎng)的數(shù)字

失心人 回答

瀏覽器緩存是這樣的:
比如說(shuō)你有一個(gè)地址是http://localhost:8089/#/demo這個(gè). 當(dāng)你第一次進(jìn)來(lái)之后其實(shí)它的資源就被瀏覽器緩存下來(lái)了. 其實(shí)它也是好心, 避免每一次都去請(qǐng)求. 減少你的壓力.
因?yàn)槟愕诙芜M(jìn)來(lái)地址還是http://localhost:8089/#/demo 所以它就不認(rèn)為你有什么資源進(jìn)行了修改.
所以我們一般在做項(xiàng)目的時(shí)候每次發(fā)布都會(huì)在地址上加上時(shí)間戳.
eg:
在你的index.html中引入了一段js.

<script type=text/javascript src=./static/js/vendor.6a0ebc1e404e6fe66792.js>

第一次進(jìn)來(lái)可能是這樣的. 但是第二次進(jìn)來(lái)你要改變它的名字

<script type=text/javascript src=./static/js/vendor.47810937849873934234.js>

這樣就解決緩存問(wèn)題了

new Image()的onload方法里面就是加載完成

嫑吢丕 回答

原來(lái)是v-for惹的貨,也就是說(shuō)你一個(gè)頁(yè)面上同時(shí)有好幾個(gè)swiper,那么根據(jù)循環(huán)的index給不同的ref,重新初始化就好了.
vue-awesome-swiper
clipboard.png
你還是改改用法吧
組件內(nèi)

<template>
  <swiper :options="swiperOption">
    <swiper-slide v-for="slide in swiperSlides">I'm Slide {{ slide }}</swiper-slide>
    <div class="swiper-pagination" slot="pagination"></div>
  </swiper>
</template>
 
<script>
import { swiper, swiperSlide } from 'vue-awesome-swiper'
 
  export default {
      components: {
        swiper,
        swiperSlide
      }
    },
    name: 'carrousel',
    data() {
      return {
        swiperOption: {
          pagination: {
            el: '.swiper-pagination'
          }
        },
        swiperSlides: [1, 2, 3, 4, 5]
      }
    },
  }
</script>
<template>
  <div class="content clearfix">
    <div class="leftBar leftHelpBar">
      <ul class="leftHelp_tab clearfix">
        <li v-for="(item, tabIndex) in items" :class="{onCur: iscur == tabIndex}" @click="setCur(tabIndex)" :key="tabIndex">{{ item.name }}</li>
      </ul>
       <ul class="help_list" v-for="(item, i) in items" :key="i" v-show="iscur == i">
        <li v-for="(item, index) in item.dataList" :key="index">
          <h3>{{ item.title }}</h3>
          <span v-for="(item, subIndex) in item.content"
                :key="subIndex"
                :class="{curStyle: `${i},${index},${subIndex}`== getcur}"
                @click="postCur(`${i},${index},${subIndex}`)">
            {{ item.subTit }}
          </span>
        </li>
      </ul>
    </div>
    <div class="rightBar">
      <div v-for="(item, i) in items" :key="i" class="help-img-con">
        <div v-for="(item, index) in item.dataList" :key="index">
          <div v-for="(item, subIndex) in item.content"
               :key="subIndex"
               v-show="`${i},${index},${subIndex}`== getcur"
               v-swiper:mySwiper="swiperOption"
               :ref=" `mySwiper${subIndex}` " <======= change here
               :options="swiperOption">
            <ul class="swiper-wrapper">
              <li v-for="(item, k) in item.img" :key="k" class="help-img-list swiper-slide">
                <img :src="item.imgsrc" alt="" />
              </li>
            </ul>
            <div class="swiper-button-next" slot="button-next"></div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import axios from 'axios'
export default {
  data () {
    return {
      iscur: 0,
      getcur: '0,0,0',
      swiperOption: {},
      items: []
    }
  },
    created(){
    axios.get('static/data/leftHelpBase.json')
      .then((res) => {
        console.log(res)
        this.items = res.data.dataInfo
      })
      .catch((err) => {
        console.log(err)
      })},
  mounted: function () {
  },
  methods: {
    setCur: function (index) {
      this.iscur = index
      this.getcur = index + ',0,0'
    },
    postCur: function (index) {
      this.getcur = index
    }
  },
  computed: {
    swiper () {
      return this.$refs.mySwiper.swiper
    }
  }
}
</script>

得,傳送門 https://segmentfault.com/q/10...