Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import {nextTick} from 'vue'
import {Options, Vue} from 'vue-class-component'
import ConfigErrorId from '@/enums/configErrorId'
import ellipsisUnnecessaryParams from '@/helpers/ellipsisUnnecessaryParams'
import formatConfigExtract from '@/helpers/formatConfigExtract'
import getTileDocUrl from '@/helpers/getTileDoc'
import guessExpectedFieldName from '@/helpers/guessExpectedFieldName'
import guessExpectedValue from '@/helpers/guessExpectedValue'
import hasConfigVerifyErrors from '@/helpers/hasConfigVerifyErrors'
import parsedExtractFieldValue from '@/helpers/parsedExpectedValue'
import splitList from '@/helpers/splitList'
import ConfigError from '@/interfaces/configError'
import {DEFAULT_CONFIG_NAME} from '@/store'
@Options({
watch: {
errors: async () => {
await nextTick()
Array.from(document.querySelectorAll('.has-mark')).forEach((errorConfigExtract: Element) => {
const pre = errorConfigExtract.parentNode?.parentNode as HTMLElement
const mark = pre.querySelector('mark')
if (mark === null) {
return
}
pre.scrollTop = mark.offsetTop - pre.offsetTop
})
},
},
})