How to use the @vue/runtime-dom.defineComponent function in @vue/runtime-dom

To help you get started, we’ve selected a few @vue/runtime-dom 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 / __tests__ / directives / vModel.spec.ts View on Github external
it('should work with textarea', async () => {
    const component = defineComponent({
      data() {
        return { value: null }
      },
      render() {
        return [
          withVModel(
            h('textarea', {
              'onUpdate:modelValue': setValue.bind(this)
            }),
            this.value
          )
        ]
      }
    })
    app.mount(component, root)
github vuejs / vue-next / packages / runtime-core / __tests__ / rendererAttrsFallthrough.spec.ts View on Github external
count.value++
          click()
        }

        return () =>
          h(Child, {
            foo: 1,
            id: 'test',
            class: 'c' + count.value,
            style: { color: count.value ? 'red' : 'green' },
            onClick: inc
          })
      }
    }

    const Child = defineComponent({
      props: {
        foo: Number
      },
      setup(props) {
        onUpdated(childUpdated)
        return () =>
          h(
            'div',
            {
              class: 'c2',
              style: { fontWeight: 'bold' }
            },
            props.foo
          )
      }
    })
github vuejs / vue-next / packages / runtime-core / __tests__ / rendererAttrsFallthrough.spec.ts View on Github external
id: 'test',
            class: 'c' + count.value,
            style: { color: count.value ? 'red' : 'green' },
            onClick: inc
          })
      }
    }

    const Child = {
      setup(props: any) {
        onUpdated(childUpdated)
        return () => h(GrandChild, props)
      }
    }

    const GrandChild = defineComponent({
      props: {
        foo: Number
      },
      setup(props) {
        onUpdated(grandChildUpdated)
        return () =>
          h(
            'div',
            {
              class: 'c2',
              style: { fontWeight: 'bold' }
            },
            props.foo
          )
      }
    })