Repository: vuejs/vue-next
File: packages/compiler-vapor/src/generators/component.ts (TypeScript)

Code before:
  ]

  function genTag() {
    if (operation.dynamic) {
      if (operation.dynamic.isStatic) {
        return genCall(
          helper('resolveDynamicComponent'),
          genExpression(operation.dynamic, context),
        )
      } else {
        return ['() => (', ...genExpression(operation.dynamic, context), ')']
      }
    } else if (operation.asset) {
      return toValidAssetId(operation.tag, 'component')
    } else {
      return genExpression(
        extend(createSimpleExpression(operation.tag, false), { ast: null }),
        context,
      )
    }
  }
}

function getUniqueHandlerName(context: CodegenContext, name: string): string {
  const { seenInlineHandlerNames } = context
  name = name.replace(':', '_')
  const count = seenInlineHandlerNames[name] || 0
  seenInlineHandlerNames[name] = count + 1
  return count === 0 ? name : `${name}${count}`
}

type InlineHandler = {
  name: string
  value: SimpleExpressionNode
}

function processInlineHandlers(
  props: IRProps[],
  context: CodegenContext,
): [Record<string, null>, InlineHandler[]] {
  const ids: Record<string, null> = Object.create(null)
  const handlers: InlineHandler[] = []
  const staticProps = props[0]
  if (isArray(staticProps)) {
    for (let i = 0; i < staticProps.length; i++) {
      const prop = staticProps[i]
      if (!prop.handler) continue
      prop.values.forEach((value, i) => {
        const isMemberExp = isMemberExpression(value, context.options)
        // cache inline handlers (fn expression or inline statement)
        if (!isMemberExp) {

Review comment (suggestion):
```vue
<Foo @handle-update="() => {}"/>
```

It is also necessary to convert `-` to `_`

Code after:
  ]

  function genTag() {
    if (operation.dynamic) {
      if (operation.dynamic.isStatic) {
        return genCall(
          helper('resolveDynamicComponent'),
          genExpression(operation.dynamic, context),
        )
      } else {
        return ['() => (', ...genExpression(operation.dynamic, context), ')']
      }
    } else if (operation.asset) {
      return toValidAssetId(operation.tag, 'component')
    } else {
      return genExpression(
        extend(createSimpleExpression(operation.tag, false), { ast: null }),
        context,
      )
    }
  }
}

function getUniqueHandlerName(context: CodegenContext, name: string): string {
  const { seenInlineHandlerNames } = context
  name = genVarName(name)
  const count = seenInlineHandlerNames[name] || 0
  seenInlineHandlerNames[name] = count + 1
  return count === 0 ? name : `${name}${count}`
}

type InlineHandler = {
  name: string
  value: SimpleExpressionNode
}

function processInlineHandlers(
  props: IRProps[],
  context: CodegenContext,
): [Record<string, null>, InlineHandler[]] {
  const ids: Record<string, null> = Object.create(null)
  const handlers: InlineHandler[] = []
  const staticProps = props[0]
  if (isArray(staticProps)) {
    for (let i = 0; i < staticProps.length; i++) {
      const prop = staticProps[i]
      if (!prop.handler) continue
      prop.values.forEach((value, i) => {
        const isMemberExp = isMemberExpression(value, context.options)
        // cache inline handlers (fn expression or inline statement)
        if (!isMemberExp) {