title: How do I combine script setup and script tags in Vue3?
body: <p>Using script setup in vue3, how do export I a constant? The following results in an error - Variable 'datafromv1' is used before being assigned.ts(2454)</p>
  <p>view1.vue</p>
  <pre><code>&lt;script setup lang=&quot;ts&quot;&gt;
  const datafromv1 = 'data from view1'
  &lt;/script&gt;
  &lt;script&gt;
  export default {
    datafromv1,                //the error is here
  };
  &lt;/script&gt;
  </code></pre>
  <p>view2.vue</p>
  <pre><code>&lt;template&gt;
      &lt;h1&gt;{{ datafromv1 }}&lt;/h1&gt;            //nothing shows here
  &lt;/template&gt;
  &lt;script setup lang=&quot;ts&quot;&gt;
  import datafromv1 from &quot;./view1.vue&quot;;
  &lt;/script&gt;
  </code></pre>