💝 Composable Promises & Promises as components
combined
slot to provide granular control over how to display while the promised is pendingPromised
- import Promised from 'vue-promised'
+ import { Promised } from 'vue-promised'
then
slot name removed. The data is now on the default slot or scoped slotpending
slot (instead of a default slot)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>
Rename error
slot to catch