Skip to content

Commit

Permalink
feat(props): discard the loadingIndicator prop
Browse files Browse the repository at this point in the history
It was decided that this is not a flexible way to set the loading indicator. To do this, do it
through a slot, for example, via the "input-end" slot.

BREAKING CHANGE: this prop no longer exists
  • Loading branch information
iliyaZelenko committed Sep 18, 2019
1 parent 941cd83 commit 0c18790
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
16 changes: 16 additions & 0 deletions gh-pages-src/pages/dev/Example2.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@
</div>
</div>
</template>
<template slot="input-end">
<!--
http://loadinggif.com/images/image-selection/3.gif
https://loading.io/
-->
<img
src="https://i.imgur.com/fLYd7PN.gif"
class="loading-indicator"
alt="loading"
>
</template>
</cool-select>
</div>
</div>
Expand Down Expand Up @@ -115,4 +126,9 @@ export default {
margin-right: 10px;
border: 1px solid #eaecf0;
}
.loading-indicator {
width: 24px;
margin-right: 5px;
}
</style>
3 changes: 0 additions & 3 deletions src/computed.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ export default {
inputForTextStyles () {
let styles = {}

if (this.loading) {
styles['background-image'] = `url(${this.loadingIndicator})`
}
if (this.inputElCustomAttributes && this.inputElCustomAttributes.style) {
styles = {
...styles,
Expand Down
5 changes: 0 additions & 5 deletions src/props.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ export default {
default: false,
note: 'display the loading indicator.'
},
loadingIndicator: { // http://loadinggif.com/images/image-selection/3.gif
type: String,
default: 'https://i.imgur.com/fLYd7PN.gif',
note: 'sets custom loading spinner/indicator. https://loading.io/'
},
disabled: {
type: Boolean,
default: false,
Expand Down

0 comments on commit 0c18790

Please sign in to comment.