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
{ | |
"screens": { | |
"sm": "640px", | |
"md": "768px", | |
"lg": "1024px", | |
"xl": "1280px" | |
}, | |
"fontFamily": { | |
"display": [ | |
"Gilroy", |
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
$is-target-ide: true; | |
$app-mode: if($is-target-ide, ide, default); | |
$base-colors: ( | |
glyph-gray: ( | |
light: pink, | |
dark: purple | |
), | |
glyph-gray-secondary: ( | |
light: rgb(110, 110, 115), |
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
$base-colors: ( | |
glyph-gray: ( | |
light: pink, | |
dark: purple | |
), | |
glyph-gray-secondary: ( | |
light: rgb(110, 110, 115), | |
dark: rgb(134, 134, 139) | |
), | |
); |
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
$component-colors: ( | |
links-item-border: ( | |
default: links-item-border-default, | |
ide: links-item-border-ide | |
), | |
link-item-bg: ( | |
default: ( | |
light: link-item-bg-default-light, | |
dark: link-item-bg-default-dark, | |
), |
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
import Vue from 'vue' | |
/** | |
* Renderless component that loads a layout component and emits the appropriate event, for the App.vue to render it. | |
* @module Layout | |
* @see module:App to see how it is implemented. | |
* @see "/layouts" for all possible layouts to load | |
*/ | |
export default { | |
name: 'Layout', |
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
<!-- Standard usage --> | |
<VButton @click.prevent="clickReturningPromise">Click me</VButton> | |
<!-- Overriding the loading state --> | |
<VButton | |
:loading="loading" | |
@click="clickWithoutPromise" | |
> | |
My loading state is passed as a prop | |
</VButton> |
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
<button | |
v-on="listeners" | |
:class="computedClasses" | |
:disabled="loadingState" | |
class="button is-primary" | |
> | |
<slot name="loading" v-if="loadingState">Loading...</slot> | |
<slot name="success" v-else-if="isSuccess">Sucess!</slot> | |
<slot name="error" v-else-if="hasError">Errored</slot> | |
<slot v-else /> |
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
resetDelayed(property) { | |
// if loading prop is passed, dont set the internal states | |
if(this.$options.propsData.hasOwnProperty('loading')) { | |
return | |
} | |
this[property] = true; | |
setTimeout(() => { | |
this[property] = false; | |
}, this.time); |
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
methods: { | |
async handleClick(event) { | |
try { | |
// set the internal loading state | |
this.isLoading = true; | |
// call the parent click listener and await it | |
// Using Async/Await lets us await even none promises | |
// pass the event so modifiers can work | |
await this.$listeners.click(event); | |
// set the isSuccess state and revert it back after this.time period |
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
export default { | |
data:() => ({ posts: [] }), | |
methods: { | |
onClick(){ | |
// return a promise from an api service | |
return this.$api.get('posts') | |
.then(r => { | |
this.posts = r.data | |
}) | |
.catch(error => { |
NewerOlder