How to use the vue-class-component.Options function in vue-class-component

To help you get started, we’ve selected a few vue-class-component examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github monitoror / monitoror / ui / src / components / Errors.vue View on Github external
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
        })
      },
    },
  })

vue-class-component

ES201X/TypeScript class decorator for Vue components

MIT
Latest version published 4 years ago

Package Health Score

64 / 100
Full package analysis