-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix lowdb permission, drawer; add youtube-dl method in select
- Loading branch information
Showing
10 changed files
with
369 additions
and
94 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Vue from 'vue'; | ||
|
||
import Async from '@/components/Globals/Async.vue'; | ||
import SizeBox from '@/components/Globals/SizeBox.vue'; | ||
|
||
Vue.component('Async', Async); | ||
Vue.component('SizeBox', SizeBox); |
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 |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<template> | ||
<span v-if="inline"> | ||
<v-progress-circular | ||
v-if="isLoading" | ||
v-bind="$attrs" | ||
indeterminate | ||
></v-progress-circular> | ||
<slot v-if="shoudShowContent" :res="res"></slot> | ||
</span> | ||
|
||
<div v-else> | ||
<v-progress-circular | ||
v-if="isLoading" | ||
v-bind="$attrs" | ||
indeterminate | ||
></v-progress-circular> | ||
<slot v-if="shoudShowContent" :res="res"></slot> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: { | ||
fn: { | ||
type: Function, | ||
default: null | ||
}, | ||
loading: { | ||
type: Boolean, | ||
default: false | ||
}, | ||
inline: { | ||
type: Boolean, | ||
default: false | ||
}, | ||
remainContent: { | ||
type: Boolean, | ||
default: false | ||
} | ||
}, | ||
data() { | ||
return { | ||
loadComplete: false, | ||
res: null | ||
}; | ||
}, | ||
computed: { | ||
isLoading() { | ||
return this.loading || !this.loadComplete; | ||
}, | ||
shoudShowContent() { | ||
return !this.isLoading || this.remainContent; | ||
} | ||
}, | ||
async mounted() { | ||
if (this.fn) { | ||
this.res = await this.fn(); | ||
} | ||
this.loadComplete = true; | ||
this.$nextTick(() => { | ||
this.$emit('load'); | ||
}); | ||
} | ||
}; | ||
</script> |
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 |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<script> | ||
const sizeUnitsRe = | ||
/[^d]m|[^d]ex[^d]|[^d]%|[^d]px|[^d]cm|[^d]mm|[^d]in|[^d]pt|[^d]pc|[^d]ch|[^d]rem|[^d]vh|[^d]vw|[^d]vmin|[^d]vmax/; | ||
const validator = (v) => { | ||
return sizeUnitsRe.test(v) || !Number.isNaN(v); | ||
}; | ||
export default { | ||
name: 'SizeBox', | ||
props: { | ||
width: { | ||
type: [String, Number], | ||
default: 0, | ||
validate(v) { | ||
return validator(v); | ||
} | ||
}, | ||
height: { | ||
type: [String, Number], | ||
default: 0, | ||
validate(v) { | ||
return validator(v); | ||
} | ||
}, | ||
minWidth: { | ||
type: [String, Number], | ||
default: 0, | ||
validate(v) { | ||
return validator(v); | ||
} | ||
}, | ||
minHeight: { | ||
type: [String, Number], | ||
default: 0, | ||
validate(v) { | ||
return validator(v); | ||
} | ||
}, | ||
inline: { | ||
type: Boolean, | ||
default: false | ||
} | ||
}, | ||
computed: { | ||
computedStyle() { | ||
return { | ||
width: Number.isNaN(this.width) | ||
? this.width | ||
: this.width | ||
? `${this.width}px` | ||
: null, | ||
height: Number.isNaN(this.height) | ||
? this.height | ||
: this.height | ||
? `${this.height}px` | ||
: null, | ||
minWidth: Number.isNaN(this.minWidth) | ||
? this.minWidth | ||
: this.minWidth | ||
? `${this.minWidth}px` | ||
: null, | ||
minHeight: Number.isNaN(this.minHeight) | ||
? this.minHeight | ||
: this.minHeight | ||
? `${this.minHeight}px` | ||
: null, | ||
display: this.inline ? 'inline-block' : 'block' | ||
}; | ||
} | ||
}, | ||
render(h) { | ||
return h('div', { style: this.computedStyle }); | ||
} | ||
}; | ||
</script> |
Oops, something went wrong.