鍍金池/ 問答/HTML/ 請教iview中render函數(shù)中slot的寫法

請教iview中render函數(shù)中slot的寫法

版本:"version": "1.1.4",
問題描述:在表格的表頭中,想加入Tooltip組件,如果Tooltip組件不使用slot插槽是正常顯示的,但當要展示的內(nèi)容過多的時候,根據(jù)文檔使用slot就會產(chǎn)生問題,請問有什么方法可以解決嗎,十分感謝。
代碼部分:
1,如果要展示內(nèi)容一行能展示開這么寫就沒有問題

{ title: '注冊充值人數(shù)', key: 'RechageCount', align: 'center', renderHeader: (h, params) =>{ 
    return h('Tooltip', { 
        props: { 
            content: '當天/周/月注冊當天/周/月充值的人數(shù)', placement: 'top' 
        } 
    }, '注冊充值人數(shù)') } 
}

2,當要展示的內(nèi)容過長時,這么寫,有bug,懸浮提示層沒有任何內(nèi)容,而表頭會把這兩個標簽的內(nèi)容全部展示出來,是因為slot不能作為屬性寫在props里面嗎?求正確寫法

{ title: '注冊充值人數(shù)', key: 'RechageCount', align: 'center', renderHeader: (h, params) ={
    return h('Tooltip', { 
        props: { placement: 'top' } 
    }, [ 
    h('span', '整體成交折標'), 
    h('div', { 
        props: { slot: 'content' }, 
        style: { widthSpace: 'normal' } 
    }, '整體成交金額中,每筆投資金額*對應(yīng)投資期限的折標系數(shù)后的加總') ])
    }
}
回答
編輯回答
尤禮
props: {},
slot: ''

放到同級

2018年6月19日 19:41