Support for Vue 3's <script setup>
See original GitHub issueThe Vue 3 starter does not support the <script setup>
block, and renders an error message:
Script missing
Example usage of <script setup>
:
<script setup>
import { ref } from 'vue'
const msg = ref('Hello World!')
</script>
<template>
<h1>{{ msg }}</h1>
<input v-model="msg">
</template>
For reference, here’s a working Vue SFC playground demo.
A workaround is to use a Node starter with Vite installed.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:10 (1 by maintainers)
Top Results From Across the Web
<script setup> | Vue.js
<script setup> is a compile-time syntactic sugar for using Composition API inside Single-File Components (SFCs). It is the recommended syntax if you are ......
Read more >The 101 guide to Script Setup in Vue 3 - VueDose
Don't you know about Script Setup yet? Check out this short article now and learn the nicest way to define a Vue component...
Read more >Support persistent layouts in Vue 3's setup sugar #651 - GitHub
When using the setup sugar (RFC), we can't use persistent layouts, because there is no way to set a property ( layout in...
Read more >Moving from Vue 2's Option API to Vue 3's Composition API
Quick introduction to help migrate from the Vue 2 options API to Vue 3's Composition ... For the purposes of this post, I'm...
Read more >What's new in Vue 3 — a roundup. Vue 3 - Medium
Why Vue 3? · Blazing fast, Vite-powered build toolchain · More ergonomic Composition API syntax via <script setup> · Improved TypeScript IDE support...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Bump. Had the same problem today. Blocker for me to use stackblitz more frequently.
Additionally the error message
Script missing
is not that meaningful.https://sfc.vuejs.org/
This does work, however it’s pretty simplistic. Definitely meets the “post on stackoverflow” necessity, but not the “use as an online project” necessity.