vuejs/vue-vapor

optimize the production build results

Open

#292 geöffnet am 19. Nov. 2024

Auf GitHub ansehen
 (3 Kommentare) (1 Reaktion) (0 zugewiesene Personen)TypeScript (115 Forks)auto 404
good first issueperformancetodo

Repository-Metriken

Stars
 (2.392 Stars)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

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
}

Contributor Guide