-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Добавлен вывод ошибки при сборе построения меню
- Loading branch information
Showing
2 changed files
with
124 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<template> | ||
<v-alert type="error" icon="error"> | ||
<pre class="err-exp-output" v-html="errorExplain" /> | ||
</v-alert> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'JSONataErrorExplainer', | ||
props: { | ||
error: { | ||
type: Object, | ||
default: null | ||
}, | ||
query: { | ||
type: Object, | ||
default: null | ||
} | ||
}, | ||
data() { | ||
return { | ||
}; | ||
}, | ||
computed: { | ||
errorExplain() { | ||
if (this.error) { | ||
const pos = this.error.position; | ||
let result = (`Error: ${this.error.message}`).replaceAll('\\n', '\n'); | ||
if (this.query) result += `\n\n${this.query.slice(0, pos)} <span style="color:red"> ${this.query.slice(pos)} </span>`; | ||
return result; | ||
} | ||
return null; | ||
} | ||
} | ||
}; | ||
</script> | ||
|
||
<style> | ||
.v-alert__content { | ||
max-width: 100%; | ||
} | ||
.err-exp-output { | ||
width: 100%; | ||
resize: none; | ||
padding: 0px; | ||
overflow-y: auto; | ||
word-wrap: break-word; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters