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

鍍金池/ 問答
祉小皓 回答

一般的都是先設(shè)置邊框顏色為透明色,懸?;騛ctive的時候設(shè)置為其他顏色

border-bottom:1px solid transparent;
你好胸 回答

這種場景使用遞歸解決

function findLastChildrens(arr) {
    var result = [];

    for(var i in arr) {
        var obj = arr[i];
        if(!obj.children) {
            continue;
        }
        var findResult = findLastChildrens(obj.children);
        if(findResult.length === 0) { //當(dāng)前children其下再沒有children出現(xiàn),說明當(dāng)前children是最后一級
            result.push(obj.children);
        } else { //不是最后一級children的話
            result = result.concat(findResult);
        }
    }
    return result;
}

findLastChildrens(arr) //返回你要所有最后一級的children組成的數(shù)組

題主改了需求,調(diào)整后的解決方案

function processLastChildrens(arr) {
    for(var i in arr) {
        var obj = arr[i];
        if(!obj.children) {
            continue;
        }
        var findResult = processLastChildrens(obj.children);
        if(!findResult) { //說明當(dāng)前children是最后一級
            obj.children = obj.children.filter(o=>o.finChfName === '阿凡達(dá)');
            findResult = true;
        } 
    }
    return findResult;
}

var newArr = [].concat(arr); //避免對原數(shù)組產(chǎn)生影響,克隆一個數(shù)組

processLastChildrens(newArr);
console.log(newArr); //打印出你期望的新數(shù)組
朕略萌 回答

setState是用來更新State的,而你push也是為了更新數(shù)據(jù)(實(shí)際上這是不允許的,因為更新數(shù)據(jù)只能用setState)。

試一試這樣

this.setState({
    data:[...this.state.data,ele]//setState里面設(shè)置新的值應(yīng)該是賦值,而不是執(zhí)行相關(guān)的函數(shù)
})
愛礙唉 回答

如果用elementUI的table就簡單多了

<template>
    <div>
        <el-table :data="data" border >
          <el-table-column label="a" prop="a"></el-table-column>
          <el-table-column label="b" prop="b"></el-table-column>
          <el-table-column label="sum">
              <template slot-scope="scope">
                  {{scope.row.a + scope.row.b}}
              </template>
          </el-table-column>
        </el-table>
    </div>
</template>

<script>
export default {
    data(){
        return {
            data: [
                {
                    a: 1,
                    b: 2,
                },
                {
                    a: 1,
                    b: 2,
                },
            ]
        }
    }
}
</script>

如果同時 sum也是可編輯的,手動將sum修改為0,a和b的值也都變?yōu)?

居然還有提這種需求的人??

不歸路 回答

根目錄下有幾種方法:

1、

<img src="/head/1.jpg" />

2、

<img src="http://網(wǎng)址/head/1.jpg" />

不支持https訪問。http可以訪問不代表https就一定可以。這個需要進(jìn)行一些配置的。

孤毒 回答

vue-cli init的說明中有個-c選項

Options:

-c, --clone use git clone

格式我是在這里找到的,vue-init -c <host>:<userName>/<repo> <projectName>,參考一下吧。

耍太極 回答

css的屬性,在js的style對象里是可以通過camelCase來訪問的,這樣做的好處是可以用.marginLeft,也可以用["marginLeft"],其實(shí)通過短號的形式也可以訪問,但就不能用.margin-left了(js語法不允許),但是可以用["margin-left"]來訪問。dom對象里兩種訪問是等價的,所以兩個屬性也是同步修改的。

type-radio js-type-radio這兩個重復(fù)的,寫死就好了啊, 判斷那個多出來的,要么加上,要么為“”

焚音 回答

eggGetRemoteWords 需要在 initUserInfo 中,登錄成功的 success 回調(diào)中執(zhí)行,所以可以這樣定義

function initUserInfo(callback) {
    wx.request({
        ...
        success: function() {
            ....
            config.uid = res.data.data.uid;
            config.accessToken = res.data.data.wxapp_access_token;
            callback(config);
            ....
        }
    });
}

然后,這樣調(diào)用

initUserInfo(() => eggGetRemoteWords());

但是一般來說,用戶信息取到之后只要不過期,是不應(yīng)該反復(fù)去取的,所以取用戶信息的部分可以封裝一下

function requestUserInfo(callback) {
    if (config.uid && config.accessToken) {
        callback(config);
    } else {
        initUserInfo(callback);
    }
}

之后調(diào)用也相應(yīng)的改成

requestUserInfo(() => eggGetRemoteWords());

上面都是采用的回調(diào)的方式來處理異步,如果想用 Promise(說實(shí)在的,我不清楚小程序目前對 Promise 支持得如何)

function initUserInfo() {
    return new Promise((resolve, reject) => {
        wx.request({
            ....
            success: function(res) {
                if (....) {
                    config.uid = ...;
                    config.accessToken = ...;
                    resolve(config);
                } else {
                    reject(res);
                }
            },
            fail: function(...args) {
                reject(res);
            }
        });
    });
}

function requestUserInfo() {
    return new Promise((resolve, reject) => {
        if (config.uid && config.accessToken) {
            resolve(config);
        } else {
            initUserInfo().then(resolve).catch(reject);
        }
    });
}

// 調(diào)用
requestUserInfo().then(eggGetRemoteWords);
// 或者
// requestUserInfo().then(eggGetRemoteWords());
耍太極 回答

之前這么寫有點(diǎn)問題,代碼里邊多了一個_ 現(xiàn)在解決了 謝謝

綰青絲 回答

我是這樣的
路由:

`{
path: '/resourseTotalDetail/:id',
name:'resourseTotal_detail',
component: ResourseTotal_detail,
meta:{index:2},
},`

頁面:

<router-link :to="'resourseTotalDetail/'+item.id"></router-link>

跳轉(zhuǎn)頁面:

watch: {
    '$route': function () {
        this.personId = this.$route.params.id;//獲取id,再請求內(nèi)容
    }
}
舊城人 回答

瀏覽器設(shè)置問題

任她鬧 回答
In Node SuperAgent does not save cookies by default, but you can use the .agent() method to create a copy of SuperAgent that saves cookies. Each copy has a separate cookie jar.

意思是說你用agent對象發(fā)的請求會保留cookie。/cookied-page只是一個示例url,你換成https://segmentfault.com/也行。
request.agent()返回的對象是request的copy(備份),所以使用API與request一樣,原來request.post('/api/pet')改成使用agent.post('/api/pet')即可,agent會保存cookie,下次發(fā)請求時會帶上。
比如你先登錄:

 agent
   .post('/api/login')
    //發(fā)送用戶名密碼登錄
   .send({ username: '用戶名', passwd: '密碼' })
    //目標(biāo)服務(wù)器返回 Set-Cookie:loginToken=38afes7a8; HttpOnly; Path=/

之后agent再發(fā)請求時會帶上用戶信息相關(guān)的cookieloginToken

讀取agent中cookie的方法文檔沒寫,看了下源碼是用的cookiejar這個包,大概是agent.jar.getCookie("loginToken", { path: "/" }).value