How to use the @vue/runtime-core.warn function in @vue/runtime-core

To help you get started, we’ve selected a few @vue/runtime-core 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 vuejs / vue-next / packages / runtime-dom / src / index.ts View on Github external
app.mount = (component, container, props): any => {
    if (isString(container)) {
      container = document.querySelector(container)!
      if (!container) {
        __DEV__ &&
          warn(`Failed to mount app: mount target selector returned null.`)
        return
      }
    }
    if (
      __RUNTIME_COMPILE__ &&
      !isFunction(component) &&
      !component.render &&
      !component.template
    ) {
      component.template = container.innerHTML
    }
    // clear content before mounting
    container.innerHTML = ''
    return mount(component, container, props)
  }
github vuejs / vue-next / packages / runtime-dom / src / directives / vModel.ts View on Github external
function setSelected(el: HTMLSelectElement, value: any) {
  const isMultiple = el.multiple
  if (isMultiple && !isArray(value)) {
    __DEV__ &&
      warn(
        `<select multiple=""> expects an Array value for its binding, ` +
          `but got ${Object.prototype.toString.call(value).slice(8, -1)}.`
      )
    return
  }
  for (let i = 0, l = el.options.length; i &lt; l; i++) {
    const option = el.options[i]
    const optionValue = getValue(option)
    if (isMultiple) {
      option.selected = looseIndexOf(value, optionValue) &gt; -1
    } else {
      if (looseEqual(getValue(option), value)) {
        el.selectedIndex = i
        return
      }
    }</select>
github vuejs / vue-next / packages / runtime-dom / src / components / Transition.ts View on Github external
function validateDuration(val: unknown) {
  if (typeof val !== 'number') {
    warn(
      ` explicit duration is not a valid number - ` +
        `got ${JSON.stringify(val)}.`
    )
  } else if (isNaN(val)) {
    warn(
      ` explicit duration is NaN - ` +
        'the duration expression might be incorrect.'
    )
  }
}
github vuejs / vue-next / packages / runtime-dom / src / components / Transition.ts View on Github external
function validateDuration(val: unknown) {
  if (typeof val !== 'number') {
    warn(
      ` explicit duration is not a valid number - ` +
        `got ${JSON.stringify(val)}.`
    )
  } else if (isNaN(val)) {
    warn(
      ` explicit duration is NaN - ` +
        'the duration expression might be incorrect.'
    )
  }
}