鍍金池/ 問答/ HTML問答
只愛你 回答

剛好寫了一部分看到 幫你補了一級 沒測過 可以試試看

<Menu @on-select='getName'>
 <template v-for="firstMenu in menuList">
      <Submenu v-if="firstMenu.children" :key="firstMenu.text" :name="firstMenu.text">
        <template slot="title">
          <Icon type="ios-navigate"></Icon>
          <span v-text="firstMenu.text"></span>
        </template>
        <template v-for="secondMenu in menuList">
          <Submenu v-if="secondMenu.children" :key="secondMenu.text" :name="secondMenu.text">
            <template slot="title">
              <Icon type="ios-navigate"></Icon>
              <span v-text="secondMenu.text"></span>
            </template>
            <Menu-Item v-for="thirdMenu in secondMenu.children"
                       :name="thirdMenu.name"
                       :key="thirdMenu.name"
                       v-html="thirdMenu.title">
            </Menu-Item>
          </Submenu>
          <Menu-Item v-else :name="secondMenu.text"
                     :key="secondMenu.text"
                     v-html="secondMenu.text">
          </Menu-Item>
        </template>
        <Menu-Item v-for="secondMenu in firstMenu.children"
                   :name="secondMenu.name"
                   :key="secondMenu.name"
                   v-html="secondMenu.title">
        </Menu-Item>
      </Submenu>
      <Menu-Item v-else :name="firstMenu.text"
                 :key="firstMenu.text"
                 v-html="firstMenu.text">
      </Menu-Item>
    </template>
</Menu>

耍太極 回答

簡單寫了個方法:

resetTree (oldTree) {
            let newTree = oldTree.map(item => {
                if (item.children) {
                    return {
                        ...item,
                        title: item.name,
                        children: this.resetTree(item.children)
                    }
                } else {
                    return {
                        ...item,
                        title: item.name
                    }
                }
            })
            return newTree
        }
兔寶寶 回答

仔細(xì)找一下路徑吧 寫一個絕對路徑

心癌 回答

axios默認(rèn)是不帶cookie的,需要把withCredentials設(shè)置為true。

心沉 回答

clipboard.png
在git的issue上找到了原因,表單組件的change事件和Pagination的current-change事件現(xiàn)在僅響應(yīng)用戶交互。1.x的版本是可以觸發(fā)的,因為升級了2.x所以有這個問題了

若相惜 回答

你把那個if的大括號去了,它控制的流程其實只有下面一行,就是那個$this->uid,就是:

if(true)
//code1 受到if控制
//code2 沒有收到if控制
陪我終 回答
.row
  p 財經(jīng)新聞:
    .buttonsRight
      .item(v-for="(item,index) in taxData.caijing"
            :class="taxDataForm.caijing.includes(item)?'active':''"
            @click="handclick('caijing',item)") {{item}}
.row
  p 熱點聚焦:
    .buttonsRight
      .item(v-for="(item,index) in taxData.redian"
            :class="taxDataForm.redian.includes(item)?'active':''"
            @click="handclick('redian',item)") {{item}}
.row
  p 行業(yè)資訊:
    .buttonsRight
      .item(v-for="(item,index) in taxData.hangye"
            :class="taxDataForm.redian.includes(item)?'active':''"
            @click="handclick('hangye',item)") {{item}}
     
            
methods:{
    handclick(str,item){
        let    arr;
        if(this.taxDataForm[str]){
            arr = this.taxDataForm[str]
        }else{return}
        arr.includes(item)?this.taxDataForm[str]=arr.filter(a=>a!==item):arr.push(item)
    }
}
何蘇葉 回答

不是很清楚你說的記住密碼是指什么適配什么樣的場景,方案太多了。

1.可以客戶端保存cookie,服務(wù)端維持session;
2.可以使用jwt(json web token);
3.可以將賬號密碼保存在localStorage里面;

……

壞脾滊 回答

Foo() 中
window.getName 被重新賦值

荒城 回答

cnode的源碼,可以去看看

墨染殤 回答

這是 firing 設(shè)置為 true 的時間段,其中會執(zhí)行 list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ],這里是執(zhí)行 callback 的地方

            for ( ; queue.length; firingIndex = -1 ) {
                memory = queue.shift();
                while ( ++firingIndex < list.length ) {

                    // Run callback and check for early termination
                    if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
                        options.stopOnFalse ) {

                        // Jump to end and forget the data so .add doesn't re-fire
                        firingIndex = list.length;
                        memory = false;
                    }
                }
            }

            // Forget the data if we're done with it
            if ( !options.memory ) {
                memory = false;
            }

而執(zhí)行 callback 的過程中將 firing 設(shè)置為 true ,memory 模式下每次 add 一個新函數(shù)都會執(zhí)行前面結(jié)過記憶的參數(shù),這里這樣做加一個 flag 防止一些不可控的 bug (例如死循環(huán))

舉個例子:

var callbacks = $.Callbacks( "memory" );
callbacks.add(function(value) { return callbacks.add(function(value) { console.log(value) }) });
callbacks.fire( "foo" );
callbacks.add(function(value) { return callbacks.add(function(value) { console.log(value) }) });

如果某一個 callback 里面重新加入了一個 callback,那么 memory 模式下就必須多次執(zhí)行之前的參數(shù),這里的結(jié)果就不是 foo foo 了。

款爺 回答

用了koa-body中間件,應(yīng)該可以直接ctx.body獲取參數(shù)好像

脾氣硬 回答

input和下拉框作為兄弟節(jié)點定位到同一個父元素。

吃藕丑 回答

select ip,devname,F.faultCode等
from (原來的查詢語句)
where ip like '%模糊條件%'
and devname like '%模糊條件%';

脾氣硬 回答

this指向的問題

img.onload=function(){
    this.render(imgInfo,num); // this指向img,而不是Barrel。img沒有render方法,所以報錯
    num++;
}

解決方案:使用箭頭函數(shù)

img.onload= () => {
    this.render(imgInfo,num);
    num++;
}
呆萌傻 回答

我這么寫,沒有你說得問題
結(jié)構(gòu)中
<el-pagination v-if="isPaging" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="currentPage3" :current-page="pageIndex" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :page-count="totalPage" :total="totalNumber"></el-pagination>

data中:

            isPaging:true,    //是否顯示分頁
            pageIndex:1,    //當(dāng)前頁(必傳)
            pageSize :10,   //每頁多少條
            currentPage:1,    //當(dāng)前顯示3頁
            currentPage3:3,
            totalNumber: 1,     //總條數(shù)
            totalPage:1 ,   //總頁數(shù)
            

methods中:

clipboard.png