-
Notifications
You must be signed in to change notification settings - Fork 35
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
12 changed files
with
353 additions
and
50 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,65 @@ | ||
<template> | ||
<div class="field"> | ||
<h2 class="title">高级模式</h2> | ||
<el-switch v-model="value" class="ml-2" /> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { defineComponent } from 'vue'; | ||
import { ElSwitch } from 'element-plus'; | ||
const DEFAULT_ADVANCED = false; | ||
export default defineComponent({ | ||
name: 'AdvancedSelector', | ||
components: { | ||
ElSwitch | ||
}, | ||
props: { | ||
modelValue: { | ||
type: Boolean, | ||
default: false | ||
} | ||
}, | ||
emits: ['update:modelValue'], | ||
data() { | ||
return { | ||
value: this.modelValue | ||
}; | ||
}, | ||
watch: { | ||
modelValue(val) { | ||
if (val !== this.value) { | ||
this.value = val; | ||
} | ||
}, | ||
value(val) { | ||
this.$emit('update:modelValue', val); | ||
} | ||
}, | ||
mounted() { | ||
if (this.value === undefined) { | ||
this.value = DEFAULT_ADVANCED; | ||
} | ||
this.$emit('update:modelValue', this.value); | ||
} | ||
}); | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.field { | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
.title { | ||
font-size: 14px; | ||
margin-bottom: 0; | ||
width: 30%; | ||
} | ||
.value { | ||
flex: 1; | ||
} | ||
} | ||
</style> |
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 |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<template> | ||
<div class="field"> | ||
<h2 class="title">画质</h2> | ||
<el-radio-group v-model="value"> | ||
<el-radio-button v-for="item in options" :key="item.value" :label="item.value"> | ||
{{ item.label }} | ||
</el-radio-button> | ||
</el-radio-group> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { defineComponent } from 'vue'; | ||
import { ElRadioButton, ElRadioGroup } from 'element-plus'; | ||
export const DEFAULT_QUALITY = '.5'; | ||
export default defineComponent({ | ||
name: 'QualitySelector', | ||
components: { | ||
ElRadioButton, | ||
ElRadioGroup | ||
}, | ||
props: { | ||
modelValue: { | ||
type: String, | ||
default: undefined | ||
} | ||
}, | ||
emits: ['update:modelValue'], | ||
data() { | ||
return { | ||
value: this.modelValue, | ||
active: 0, | ||
options: [ | ||
{ | ||
label: '低', | ||
value: '.25' | ||
}, | ||
{ | ||
label: '中', | ||
value: '.5' | ||
}, | ||
{ | ||
label: '高', | ||
value: '1' | ||
} | ||
] | ||
}; | ||
}, | ||
watch: { | ||
modelValue(val) { | ||
if (val !== this.value) { | ||
this.value = val; | ||
} | ||
}, | ||
value(val) { | ||
this.$emit('update:modelValue', val); | ||
} | ||
}, | ||
mounted() { | ||
if (!this.value) { | ||
this.value = DEFAULT_QUALITY; | ||
} | ||
this.$emit('update:modelValue', this.value); | ||
} | ||
}); | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.field { | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
.title { | ||
font-size: 14px; | ||
margin-bottom: 0; | ||
width: 30%; | ||
} | ||
.value { | ||
flex: 1; | ||
} | ||
} | ||
</style> |
Oops, something went wrong.