MCPcopy
hub / github.com/vuejs/core / setup

Function setup

packages/runtime-dom/__tests__/customElement.spec.ts:79–89  ·  view source on GitHub ↗
(props, { emit })

Source from the content-addressed store, hash-verified

77 props: ['value'],
78 emits: ['update'],
79 setup(props, { emit }) {
80 return () =>
81 h('input', {
82 type: 'number',
83 value: props.value,
84 onInput: (e: InputEvent) => {
85 const num = (e.target! as HTMLInputElement).valueAsNumber
86 emit('update', Number.isNaN(num) ? null : num)
87 },
88 })
89 },
90 })
91 customElements.define('my-el-input', CustomInput)
92 const num = ref('12')

Callers

nothing calls this directly

Calls 10

hFunction · 0.90
injectFunction · 0.90
provideFunction · 0.90
useHostFunction · 0.90
useShadowRootFunction · 0.90
refFunction · 0.90
exposeFunction · 0.85
createElementMethod · 0.80
pushMethod · 0.65
emitFunction · 0.50

Tested by

no test coverage detected