admin big changes
This commit is contained in:
@@ -6,8 +6,8 @@
|
||||
:disabled="disabled"
|
||||
@change="onSwitchChange"
|
||||
>
|
||||
<template #checkedChildren>فعال</template>
|
||||
<template #unCheckedChildren>غیرفعال</template>
|
||||
<template #checkedChildren>{{ labels.on }}</template>
|
||||
<template #unCheckedChildren>{{ labels.off }}</template>
|
||||
</a-switch>
|
||||
|
||||
<ZaarboxPriceKeyField
|
||||
@@ -63,10 +63,11 @@
|
||||
<script setup lang="ts">
|
||||
import ZaarboxPriceKeyField from './ZaarboxPriceKeyField.vue'
|
||||
import {
|
||||
isSwitchOn,
|
||||
parseSelectOptions,
|
||||
resolveSettingFieldType,
|
||||
switchToString,
|
||||
resolveSwitchChecked,
|
||||
switchLabels,
|
||||
switchValueFromChecked,
|
||||
type SettingFieldType
|
||||
} from './settingTypes'
|
||||
|
||||
@@ -101,10 +102,12 @@ const selectItems = computed(() =>
|
||||
})
|
||||
)
|
||||
|
||||
const switchChecked = computed(() => isSwitchOn(props.modelValue))
|
||||
const labels = computed(() => switchLabels(props.settingKey))
|
||||
|
||||
const switchChecked = computed(() => resolveSwitchChecked(props.settingKey, props.modelValue))
|
||||
|
||||
function onSwitchChange(checked: boolean) {
|
||||
emit('update:value', switchToString(checked))
|
||||
emit('update:value', switchValueFromChecked(props.settingKey, checked))
|
||||
}
|
||||
|
||||
function onSelectChange(val: string | undefined) {
|
||||
|
||||
Reference in New Issue
Block a user