Lint/prettify
This commit is contained in:
@ -2,25 +2,25 @@
|
||||
import { getDefaultSettings } from '@/mixins'
|
||||
|
||||
export default {
|
||||
setup() {
|
||||
let settings
|
||||
setup() {
|
||||
let settings
|
||||
|
||||
let storedSettings = localStorage.getItem("settings")
|
||||
if (storedSettings === null) {
|
||||
settings = getDefaultSettings()
|
||||
} else {
|
||||
settings = JSON.parse(storedSettings)
|
||||
}
|
||||
let storedSettings = localStorage.getItem('settings')
|
||||
if (storedSettings === null) {
|
||||
settings = getDefaultSettings()
|
||||
} else {
|
||||
settings = JSON.parse(storedSettings)
|
||||
}
|
||||
|
||||
return {
|
||||
settings
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
save() {
|
||||
const settings = JSON.stringify(this.settings)
|
||||
localStorage.setItem('settings', settings)
|
||||
},
|
||||
return {
|
||||
settings
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
save() {
|
||||
const settings = JSON.stringify(this.settings)
|
||||
localStorage.setItem('settings', settings)
|
||||
}
|
||||
// download() {
|
||||
// var hiddenElement = document.createElement('a');
|
||||
|
||||
@ -40,37 +40,42 @@ export default {
|
||||
// this.settings = file
|
||||
// this.save()
|
||||
// },
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="mx-auto w-[35rem] p-5 py-3 bg-ctp-crust rounded-md text-white">
|
||||
<h1 class="font-bold text-3xl">Settings</h1>
|
||||
<hr class="my-2">
|
||||
<ul class="w-full space-y-1">
|
||||
<li v-for="setting in settings">
|
||||
<div v-if="setting.type == 'checkbox'" class="justify-between items-center flex">
|
||||
<label :for="setting.name">{{ setting.name }}</label>
|
||||
<input :name="setting.name" type="checkbox" v-model="setting.selected">
|
||||
</div>
|
||||
<div class="mx-auto w-[35rem] p-5 py-3 bg-ctp-crust rounded-md text-white">
|
||||
<h1 class="font-bold text-3xl">Settings</h1>
|
||||
<hr class="my-2" />
|
||||
<ul class="w-full space-y-1">
|
||||
<li v-for="setting in settings" :key="setting.type">
|
||||
<div v-if="setting.type == 'checkbox'" class="justify-between items-center flex">
|
||||
<label :for="setting.name">{{ setting.name }}</label>
|
||||
<input :name="setting.name" type="checkbox" v-model="setting.selected" />
|
||||
</div>
|
||||
|
||||
<div v-else-if="setting.type == 'option'" class="justify-between items-center flex">
|
||||
<label :for="setting.name">{{ setting.name }}</label>
|
||||
<select :name="setting.name" type="checkbox" v-model="setting.selected"
|
||||
class="text-black rounded-md h-8 p-0 pr-8 pl-2">
|
||||
<option v-for="option of setting.options" :value="option">
|
||||
{{ option }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div v-else-if="setting.type == 'option'" class="justify-between items-center flex">
|
||||
<label :for="setting.name">{{ setting.name }}</label>
|
||||
<select
|
||||
:name="setting.name"
|
||||
type="checkbox"
|
||||
v-model="setting.selected"
|
||||
class="text-black rounded-md h-8 p-0 pr-8 pl-2"
|
||||
>
|
||||
<option v-for="option of setting.options" :key="option" :value="option">
|
||||
{{ option }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="space-x-2 mt-3">
|
||||
<button @click="save" class="bg-ctp-surface0 p-4 py-2 rounded-md">Save</button>
|
||||
<!-- <button @click="download" class="bg-ctp-surface0 p-4 py-2 rounded-md">Export</button>
|
||||
<div class="space-x-2 mt-3">
|
||||
<button @click="save" class="bg-ctp-surface0 p-4 py-2 rounded-md">Save</button>
|
||||
<!-- <button @click="download" class="bg-ctp-surface0 p-4 py-2 rounded-md">Export</button>
|
||||
<input type="file" @change="handleImport" name="fileinput" ref="fileinput"
|
||||
class="bg-ctp-surface0 p-4 py-2 rounded-md"> -->
|
||||
</div>
|
||||
</div></template>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
Reference in New Issue
Block a user