vue.jsvue-componentvuejs3vue-sfcvue-script-setup

How can I use new <script setup> syntax in Vue SFC without template section?


When I try to write SFC with <script setup> but without <template>, I get a warning in console [Vue warn] Component is missing template or render function.

Is there any workaround?


Solution

  • Vuejs dev answers, that one can use empty <template> in this case.