Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'web/html/xui/component/setting.html')
-rw-r--r--web/html/xui/component/setting.html50
1 files changed, 27 insertions, 23 deletions
diff --git a/web/html/xui/component/setting.html b/web/html/xui/component/setting.html
index 8adc000c..bc2c6e42 100644
--- a/web/html/xui/component/setting.html
+++ b/web/html/xui/component/setting.html
@@ -1,26 +1,18 @@
{{define "component/settingListItem"}}
-<a-list-item style="padding: 20px">
- <a-row v-if="type === 'textarea'">
- <a-col>
- <a-list-item-meta :title="title" :description="desc"/>
- <a-textarea class="ant-setting-textarea" :value="value" @input="$emit('input', $event.target.value)" :auto-size="{ minRows: 10 }"></a-textarea>
- <!--a-textarea :value="value" @input="$emit('input', $event.target.value)" :auto-size="{ minRows: 10, maxRows: 30 }"></a-textarea-->
- </a-col>
- </a-row>
- <a-row v-else>
+<a-list-item :style="{ padding: padding }">
+ <a-row>
<a-col :lg="24" :xl="12">
- <a-list-item-meta :title="title" :description="desc"/>
+ <a-list-item-meta>
+ <template #title>
+ <slot name="title"></slot>
+ </template>
+ <template #description>
+ <slot name="description"></slot>
+ </template>
+ </a-list-item-meta>
</a-col>
<a-col :lg="24" :xl="12">
- <template v-if="type === 'text'">
- <a-input :value="value" @input="$emit('input', $event.target.value)" :placeholder="placeholder"></a-input>
- </template>
- <template v-else-if="type === 'number'">
- <a-input-number :value="value" :step="step" @change="value => $emit('input', value)" :min="min" :max="max" style="width: 100%;"></a-input-number>
- </template>
- <template v-else-if="type === 'switch'">
- <a-switch :checked="value" @change="value => $emit('input', value)"></a-switch>
- </template>
+ <slot name="control"></slot>
</a-col>
</a-row>
</a-list-item>
@@ -28,9 +20,21 @@
{{define "component/setting"}}
<script>
- Vue.component('setting-list-item', {
- props: ["type", "title", "desc", "value", "min", "max" , "step", "placeholder"],
- template: `{{template "component/settingListItem"}}`,
- });
+ Vue.component('a-setting-list-item', {
+ props: ["title", "description", "paddings"],
+ template: `{{ template "component/settingListItem" }}`,
+ computed: {
+ padding() {
+ switch (this.paddings) {
+ case "small":
+ return "10px 20px !important"
+ break;
+ default:
+ return "20px !important"
+ break;
+ }
+ }
+ }
+ })
</script>
{{end}}