fix: the spin component loads for the first time #174

pull/179/head
wangxueliang 6 years ago
parent 9d3c448279
commit 85a9aca492

@ -0,0 +1,19 @@
import { mount } from '@vue/test-utils'
import { asyncExpect } from '@/tests/utils'
import List from '..'
describe('List', () => {
it('locale not passed to internal div', async () => {
const locale = { emptyText: 'Custom text' }
const wrapper = mount({
render () {
return <List dataSource={[]} renderItem={(item) => <List.Item>{item}</List.Item>} locale={locale} />
},
}, {
sync: false,
})
await asyncExpect(() => {
expect(wrapper.props().locale).toBe(undefined)
})
})
})

@ -148,7 +148,7 @@ export default {
return ( return (
<transition-group <transition-group
{...getTransitionProps('fade')} {...getTransitionProps('fade', { appear: false })}
tag='div' tag='div'
class={animateClassName} class={animateClassName}
> >

@ -140,7 +140,10 @@ exports[`renders ./components/transfer/demo/large-data.md correctly 1`] = `
<div class="ant-transfer"> <div class="ant-transfer">
<div class="ant-transfer-list"> <div class="ant-transfer-list">
<div class="ant-transfer-list-header"><label class="ant-checkbox-wrapper"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input" value=""><span class="ant-checkbox-inner"></span></span></label><span class="ant-transfer-list-header-selected"><span>2000 items</span><span class="ant-transfer-list-header-title"></span></span></div> <div class="ant-transfer-list-header"><label class="ant-checkbox-wrapper"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input" value=""><span class="ant-checkbox-inner"></span></span></label><span class="ant-transfer-list-header-selected"><span>2000 items</span><span class="ant-transfer-list-header-title"></span></span></div>
<div class="ant-transfer-list-body"> <div class="ant-transfer-list-body ant-transfer-list-body-with-search">
<div class="ant-transfer-list-body-search-wrapper">
<div><input value="" placeholder="Search here" type="text" class="ant-input ant-transfer-list-search ant-transfer-list-search"><span class="ant-transfer-list-search-action"><i class="anticon anticon-search"></i></span></div>
</div>
<ul class="ant-transfer-list-content"> <ul class="ant-transfer-list-content">
<div class="LazyLoad" style="height: 32px;"></div> <div class="LazyLoad" style="height: 32px;"></div>
<div class="LazyLoad" style="height: 32px;"></div> <div class="LazyLoad" style="height: 32px;"></div>
@ -2149,7 +2152,10 @@ exports[`renders ./components/transfer/demo/large-data.md correctly 1`] = `
<div class="ant-transfer-operation"><button type="button" disabled="disabled" class="ant-btn ant-btn-primary ant-btn-sm"><i class="anticon anticon-right"></i></button><button type="button" disabled="disabled" class="ant-btn ant-btn-primary ant-btn-sm"><i class="anticon anticon-left"></i></button></div> <div class="ant-transfer-operation"><button type="button" disabled="disabled" class="ant-btn ant-btn-primary ant-btn-sm"><i class="anticon anticon-right"></i></button><button type="button" disabled="disabled" class="ant-btn ant-btn-primary ant-btn-sm"><i class="anticon anticon-left"></i></button></div>
<div class="ant-transfer-list"> <div class="ant-transfer-list">
<div class="ant-transfer-list-header"><label class="ant-checkbox-wrapper"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input" value=""><span class="ant-checkbox-inner"></span></span></label><span class="ant-transfer-list-header-selected"><span>0 item</span><span class="ant-transfer-list-header-title"></span></span></div> <div class="ant-transfer-list-header"><label class="ant-checkbox-wrapper"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input" value=""><span class="ant-checkbox-inner"></span></span></label><span class="ant-transfer-list-header-selected"><span>0 item</span><span class="ant-transfer-list-header-title"></span></span></div>
<div class="ant-transfer-list-body"> <div class="ant-transfer-list-body ant-transfer-list-body-with-search">
<div class="ant-transfer-list-body-search-wrapper">
<div><input value="" placeholder="Search here" type="text" class="ant-input ant-transfer-list-search ant-transfer-list-search"><span class="ant-transfer-list-search-action"><i class="anticon anticon-search"></i></span></div>
</div>
<ul class="ant-transfer-list-content"></ul> <ul class="ant-transfer-list-content"></ul>
<div class="ant-transfer-list-body-not-found">Not Found</div> <div class="ant-transfer-list-body-not-found">Not Found</div>
</div> </div>

@ -15,6 +15,7 @@
:targetKeys="targetKeys" :targetKeys="targetKeys"
@change="handleChange" @change="handleChange"
:render="item=>item.title" :render="item=>item.title"
showSearch
> >
</a-transfer> </a-transfer>
</template> </template>

Loading…
Cancel
Save