vuejs/vue-vapor

optimize the production build results

Open

#292 aberto em 19 de nov. de 2024

Ver no GitHub
 (3 comments) (1 reaction) (0 assignees)TypeScript (115 forks)auto 404
good first issueperformancetodo

Métricas do repositório

Stars
 (2.392 stars)
Métricas de merge de PR
 (Métricas PR pendentes)

Description

Note that this is not a real bug, just an optimization item.

see Playground

It seems no need to wrap it as an IIFE.

setup(__props) {
  const msg = ref('Hello World!')
  return ((_ctx) => {
    const n0 = t0()
    _setInheritAttrs(false)
    _renderEffect(() => _setText(n0, msg.value))
    return n0
  })()
}

better is:

setup(__props) {
  const msg = ref('Hello World!')
  const n0 = t0()
  _setInheritAttrs(false)
  _renderEffect(() => _setText(n0, msg.value))
  return n0
}

Guia do colaborador