mirror of
https://github.com/alireza0/s-ui.git
synced 2026-08-31 16:31:07 +00:00
fix empty ruleset
This commit is contained in:
parent
cc45e8de20
commit
4f7a90b7dd
1 changed files with 8 additions and 2 deletions
|
|
@ -164,17 +164,23 @@ const route = computed((): any => {
|
|||
|
||||
const rules = computed((): any[] => {
|
||||
const data = route.value
|
||||
if (!data || !('rules' in data) || !Array.isArray(data.rules)){
|
||||
if (!data){
|
||||
return []
|
||||
}
|
||||
if (!('rules' in data) || !Array.isArray(data.rules)) {
|
||||
data.rules = []
|
||||
}
|
||||
return data.rules
|
||||
})
|
||||
|
||||
const rulesets = computed((): any[] => {
|
||||
const data = route.value
|
||||
if (!data || !('rule_set' in data) || !Array.isArray(data.rule_set)){
|
||||
if (!data){
|
||||
return []
|
||||
}
|
||||
if (!('rule_set' in data) || !Array.isArray(data.rule_set)) {
|
||||
data.rule_set = []
|
||||
}
|
||||
return data.rule_set
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue