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

鍍金池/ 問答/ HTML問答
熟稔 回答

for循環(huán)是可以的。

var nodeList = document.getElementsByTagName('div'); 
for (var i = 0; i < nodeList.length; i++) {
    // code here
    console.log(1);
}

面試官可能更希望你回答出,這是array-like-object 類數(shù)組對(duì)象,怎么轉(zhuǎn)換成數(shù)組。再做循環(huán)。

方案一:ES5 Array.prototype.slice.call

var nodeList = document.getElementsByTagName('div'));
var nodeArr = Array.prototype.slice.call(nodeList);
// [].slice.call() 這個(gè)也可以
Array.isArray(nodeArr); // true
nodeArr.forEach(() => {
    console.log(1);
});

方案二:ES6 擴(kuò)展符 ...

// NodeList對(duì)象
var nodeArr = [...document.querySelectorAll('div')];
nodeArr.forEach(() => {
    console.log(1);
});

方案三:ES6 Array.from

Array.from(document.querySelectorAll('div')).forEach(() => {
    // code here
    console.log(1);
});

面試官應(yīng)該是想要你說出轉(zhuǎn)成數(shù)組這三種方案。希望對(duì)你有幫助~

不歸路 回答

經(jīng)過查找資料發(fā)現(xiàn)問題所在:

因后臺(tái)報(bào)錯(cuò)發(fā)生在'title': req.body.pictitle,這一句,且報(bào)錯(cuò)信息為: Cannot read property 'pictitle' of undefined。于是定位問題在圖片上傳過程POST數(shù)據(jù)獲取失敗,調(diào)試ueditor包:console.log(req.body)發(fā)現(xiàn)為undefined,所以確定問題點(diǎn)。

解決關(guān)鍵:

因express借助body-parser模塊處理post請(qǐng)求中攜帶的數(shù)據(jù),所以在controller中查看bodyparser設(shè)置問題,發(fā)現(xiàn):

app.use(bodyParser.urlencoded({extended:true}));

當(dāng)前中間件在圖片上傳設(shè)置的中間件之后(因?yàn)槭菧y(cè)試部署ueditor所以app.use("/ueditor",.....))的中間件設(shè)置代碼是隨意放置的,因此導(dǎo)致了圖片上傳失敗。

解決方案:

將body-parser中間件放到ueditor圖片上傳設(shè)置的前面即可

希望對(duì)類似錯(cuò)誤的朋友有幫助

玩控 回答

就是執(zhí)行v.default 方法,傳進(jìn)去一個(gè)參數(shù) "_w_tb_nick"

別傷我 回答

如果是這樣的一個(gè)邏輯的話:C->A<->B。
那么B向A的按鈕跳轉(zhuǎn)可以使用this.$router.replace({name: 'A'}),這樣回退只能去C了。而A->B的跳轉(zhuǎn)邏輯不受影響。

不是的話你就在A的beforeRouteLeave(to, from)拿到to和from做判斷吧,當(dāng)然此時(shí)還靠記錄過是否已去過B的一個(gè)量做下判斷。

終相守 回答
handleChange2 = ({ fileList }) => this.setState({ fileList2: fileList });
陌璃 回答

Here comes oneliner

const countSuccession = s => s.match(/(.)\1*/g).reduce((r, x) => r + x[0] + x.length, '')
console.log(countSuccession('aaaaaabbbbbccccddac'))
終相守 回答

先卸載最新的
npm uninstall vue-awesome-swiper

安裝這個(gè)低版本就可以了
npm install vue-awesome-swiper@2.6.7 --save

誮惜顏 回答

是版本的原因,我把版本降到3.幾就可以了

吢涼 回答

拋出的錯(cuò)誤意思是geoCoordMap[dataItem[1].name]沒有concat這個(gè)方法。

一般來講,可能的原因是你map中的某一個(gè)geoCoordMap[dataItem[1].name]undefined...。

在你map的函數(shù)中,return之前,console.log(dataItem[1].name, geoCoordMap[dataItem[1].name])就知道是哪個(gè)數(shù)據(jù)出問題了。

半心人 回答

給this指向的對(duì)象賦值啊

你直接在瀏覽器的console里打

this['test'] = 'test' // this->window

然后打印window對(duì)象可以看到對(duì)應(yīng)的屬性

clipboard.png

萌小萌 回答

undefinedconsole.log的返回值,你可以試著覆蓋console.log來改變默認(rèn)輸出:

let tmp = console.log.bind(console)
console.log = function() {tmp(...arguments); return 1}
console.log(3)

clipboard.png

荒城 回答

你好,我把你代碼貼出來運(yùn)行了,改了兩個(gè)地方就好了。
第一個(gè):

<Form ref="formValue" :model="formValue" :rules="formRules" :label-width="80">

v-model="formValue" ->:model="formValue"
第二個(gè)
{ required: true, message: 'Please select the country', pattern: '/.+/', trigger: 'change' }->{ required: true, message: 'Please select the country', trigger: 'change' }
以下完整代碼

<template>
<div class="form abs-center">

<Form ref="formValue" :model="formValue" :rules="formRules" :label-width="80">
  <FormItem label="Name" prop="name">
    <Input v-model="formValue.name" placeholder="Enter your name" />
  </FormItem>
  <FormItem label="Country" prop="country">
    <Select v-model="formValue.country" placeholder="Select your country" prop="country" @on-change="change">
      <Option value="China">China</Option>
      <Option value="U.S.A.">U.S.A.</Option>
      <Option value="Janpan">Janpan</Option>
    </Select>
  </FormItem>
</Form>
</div>
</template>

<script>
export default {
  name: "Step1",
  data() {
    return {
      formValue: {
        name: "",
        country: ""
      },
      formRules: {
        name: [
          {
            required: true,
            message: "The name cannot be empty",
            trigger: "blur"
          }
        ],
        country: [
          {
            required: true,
            message: "Please select the country",
            // pattern: "/.+/",
            trigger: "change"
          }
        ]
      }
    };
  },
};
</script>
心上人 回答

后來搜到給具有默認(rèn)參數(shù)的方法傳參
@check="(v,check)=>{changeTree(v,check,item,i)}"
如此,默認(rèn)參數(shù)可直接返回被選中的節(jié)點(diǎn),將該節(jié)點(diǎn)賦值給item的某個(gè)屬性,就能拿到每個(gè)樹菜單的選中的節(jié)點(diǎn)

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

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

情未了 回答

我寫的簡(jiǎn)單的demo可以看看
鏈接

尛曖昧 回答

與content-type有關(guān),可以注意下不同傳參數(shù)方法下content-type的不同

清夢(mèng) 回答

這個(gè)是柵格布局

span 柵格占據(jù)的列數(shù)
offset 柵格左側(cè)的間隔格數(shù)

而下面的代碼是對(duì)上述信息的動(dòng)態(tài)設(shè)置,用于頁(yè)面自適應(yīng)等等。

var checkboxSpan = emrPartsOptions.length * 3;
var checkboxOffset = (24 - checkboxSpan) / 2;