mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-06-08 01:01:13 +08:00
🚧 WIP: gallery db in progress
This commit is contained in:
@@ -8,31 +8,27 @@
|
||||
</el-switch>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'choose-pic-bed',
|
||||
props: {
|
||||
type: String,
|
||||
label: String
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
value: false
|
||||
}
|
||||
},
|
||||
created () {
|
||||
if (this.type === this.$db.get('picBed.current')) {
|
||||
<script lang="ts">
|
||||
import { Component, Vue, Prop } from 'vue-property-decorator'
|
||||
@Component({
|
||||
name: 'choose-pic-bed'
|
||||
})
|
||||
export default class extends Vue {
|
||||
value = false
|
||||
@Prop() type!: string
|
||||
@Prop() label!: string
|
||||
async created () {
|
||||
const current = await this.getConfig<string>('picBed.current')
|
||||
if (this.type === current) {
|
||||
this.value = true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
choosePicBed (val) {
|
||||
this.letPicGoSaveData({
|
||||
'picBed.current': this.type,
|
||||
'picBed.uploader': this.type
|
||||
})
|
||||
this.$emit('update:choosed', this.type)
|
||||
}
|
||||
}
|
||||
choosePicBed (val: string) {
|
||||
this.saveConfig({
|
||||
'picBed.current': this.type,
|
||||
'picBed.uploader': this.type
|
||||
})
|
||||
this.$emit('update:choosed', this.type)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -80,10 +80,10 @@ export default class extends Vue {
|
||||
deep: true,
|
||||
immediate: true
|
||||
})
|
||||
handleConfigChange (val: any) {
|
||||
async handleConfigChange (val: any) {
|
||||
this.ruleForm = Object.assign({}, {})
|
||||
const config = this.$db.get(`picBed.${this.id}`)
|
||||
if (val.length > 0) {
|
||||
const config = await this.getConfig<IPicGoPluginConfig>(`picBed.${this.id}`)
|
||||
if (val.length > 0 && config) {
|
||||
this.configList = cloneDeep(val).map((item: any) => {
|
||||
let defaultValue = item.default !== undefined
|
||||
? item.default : item.type === 'checkbox'
|
||||
|
||||
Reference in New Issue
Block a user