-
Notifications
You must be signed in to change notification settings - Fork 252
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
283 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,13 +7,13 @@ | |
class="btn" | ||
@click="onClick" | ||
> | ||
<loader v-if="loading" class="btn__loader" small /> | ||
<loader v-if="isLoading" class="btn__loader" small /> | ||
<slot /> | ||
</component> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { Component, Vue } from 'vue-property-decorator' | ||
import { Component, Vue, Watch } from 'vue-property-decorator' | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Tucsky
Author
Owner
|
||
import Loader from '@/components/framework/Loader.vue' | ||
@Component({ | ||
|
@@ -50,10 +50,15 @@ import Loader from '@/components/framework/Loader.vue' | |
} | ||
}) | ||
export default class Btn extends Vue { | ||
loading: boolean | ||
isLoading = false | ||
@Watch('loading') | ||
onLoadingChange(value) { | ||
this.isLoading = value | ||
} | ||
onClick(event) { | ||
if (!this.loading) { | ||
if (!this.isLoading) { | ||
this.$emit('click', event) | ||
} | ||
} | ||
|
@@ -63,7 +68,6 @@ export default class Btn extends Vue { | |
<style lang="scss" scoped> | ||
.btn { | ||
&__loader { | ||
margin-right: 0.5rem; | ||
width: 0.5em; | ||
height: 0.5em; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Quick comment about this:
Vue 2.7.14 and above provides built-in support for Composition API. You could easily remove that library which is no longer maintained.