New Features
combined
slot to provide granular control over how to display while the promised is pending
Improvements
- A default slot will now show when the promised is resolved
Breaking changes
- default export renamed to
Promised
- import Promised from 'vue-promised'
+ import { Promised } from 'vue-promised'
then
slot name removed. The data is now on the default slot or scoped slot
- pending state of a promise must now be displayed using the
pending
slot (instead of a default slot)
- the
catch
slot is now named rejected
(status of the promise):
<Promised :promise="promise">
- <div>Loading</div>
+ <div slot="pending">Loading</div>
- <div slot="then" scoped-slot="data">{{ data }}</div>
+ <div scoped-slot="data">{{ data }}</div>
- <div slot="catch" scoped-slot="error">{{ error.message }}</div>
+ <div slot="rejected" scoped-slot="error">{{ error.message }}</div>
</Promised>