Problems when using script-setup
Version
3.2.31
Reproduction link
Steps to reproduce
在本地运行时没有问题。但是,打包之后,放到线上环境,控制台会报错。
What is expected?
正常显示图片
What is actually happening?
不正常显示,控制台报错”ReferenceError: _unref is not defined“
This may just be a limitation of Webpack. It likely can't statically analyze arbitrarily complex string interpolations.
Hi, thanks for your interest but Github issues are for bug reports and feature requests only. You can ask questions on the forum, the Discord server or StackOverflow.
这个方法不行吗?
另外你需要提供一个简单可复现的 demo。
vue版本3.2.31。看到一个相似的情况https://stackoverflow.com/questions/71555955/vue-js-3-error-referenceerror-unref-is-not-defined
<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>
在本地运行没有问题,但是打包后,线上会报错。控制台会出现报错信息:ReferenceError: _unref is not defined
而且如果我不使用