Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

169
Views
vue3.2x use <script setup>, Build does not resolve computed properties in :src="require()"

vue 3.2.31 use <script setup>

  <template>
    <img :src="require(`@/assets/images/icon_num_${state.lotteryNum}.png`)" alt="" />
</template>
<script setup lang="ts">
import {reactive} from 'vue'
const state = reactive({
    lotteryNum:1,
})
</script>

When running locally, there is no problem. But after packaging, the console will report an error when running online.

enter image description here

error message: ReferenceError: _unref is not defined

I tried not to use <script setup>,There is no problem with running locally, and there is no problem with running after packaging。

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!