mirror of
https://github.com/cuigh/swirl
synced 2024-12-28 14:51:57 +00:00
Fix bug
This commit is contained in:
parent
6705bd6d64
commit
94127504ff
@ -31,7 +31,7 @@
|
||||
<n-form-item-gi
|
||||
:label="t('fields.replicas')"
|
||||
path="replicas"
|
||||
v-show="['replicated', 'replicated-job'].includes(model.mode)"
|
||||
v-if="['replicated', 'replicated-job'].includes(model.mode)"
|
||||
>
|
||||
<n-input-number
|
||||
:placeholder="t('fields.replicas')"
|
||||
@ -564,13 +564,13 @@ const showMore = ref(false);
|
||||
const rules: any = {
|
||||
name: requiredRule(),
|
||||
mounts: customRule((rule: any, value: any[]) => {
|
||||
return value.every(v => v.source && v.target)
|
||||
return value?.every(v => v.source && v.target)
|
||||
}, t('tips.mounts_rule')),
|
||||
configs: customRule((rule: any, value: any[]) => {
|
||||
return value.every(v => v.key && v.path)
|
||||
return value?.every(v => v.key && v.path)
|
||||
}, t('tips.files_rule')),
|
||||
secrets: customRule((rule: any, value: any[]) => {
|
||||
return value.every(v => v.key && v.path)
|
||||
return value?.every(v => v.key && v.path)
|
||||
}, t('tips.files_rule')),
|
||||
};
|
||||
const mountTypeOptions = [
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { isRef, onMounted, reactive } from "vue"
|
||||
import { t } from "@/locales";
|
||||
|
||||
export function useDataTable(loader: Function, filter: Object | Function) {
|
||||
export function useDataTable(loader: Function, filter: Object | Function, autoFetch: boolean = true) {
|
||||
const state = reactive({
|
||||
loading: false,
|
||||
data: [],
|
||||
@ -42,7 +42,9 @@ export function useDataTable(loader: Function, filter: Object | Function) {
|
||||
fetchData()
|
||||
}
|
||||
|
||||
if (autoFetch) {
|
||||
onMounted(fetchData)
|
||||
}
|
||||
|
||||
return { state, pagination, fetchData, changePageSize }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user