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

setting.html « component « xui « html « web - github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8adc000c1a00623b5ce151fd2dd1f729352394a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{{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-col :lg="24" :xl="12">
            <a-list-item-meta :title="title" :description="desc"/>
        </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>
        </a-col>
    </a-row>
</a-list-item>
{{end}}

{{define "component/setting"}}
<script>
    Vue.component('setting-list-item', {
        props: ["type", "title", "desc", "value", "min", "max" , "step", "placeholder"],
        template: `{{template "component/settingListItem"}}`,
    });
</script>
{{end}}