|
|
|
|
|
by spion
3220 days ago
|
|
Ok I think I figured out how to use a template with a slot in the spinner component: <div>
<img v-if="this.status == 'pending'"
src="https://media.giphy.com/media/10kTz4r3ishQwU/giphy.gif" />
<slot v-if="this.status == 'success'" :list="this.data"></slot>
<div v-if="this.status == 'error'">{{this.error}}</div>
</div>
Then in the template the option line becomes <option v-for="option in data.list" :value="option">{{option}}</option>
Not too bad. Guess I'll have to come up with a new example of what Vue templates can't do now! |
|