using vue script setup with cdn

Viewed 23

do we have a way to write compostion api script setup with cdn like this?

<template>
{{message}}
</template>

<script setup>

 message:"welcome"; 



</script>

I searched for it but found no solutions I used it in vue 2 and it is available in vue 3 options api but is there anyway to do the same in script setup? Thanks

1 Answers

I'm not sure what you want to do, but this will work (playground):

<template>
  {{ message }}
</template>

<script setup>
  const message = "welcome"
</script>

I recommend you to read the Vue Composition API faq.

Related