-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
新建默认模板,H5无法调用图片 #7869
Comments
taro-bot2
bot
added
F-vue2
Framework - Vue 2
T-h5
Target - 编译到 H5
V-3
Version - 3.x
labels
Oct 20, 2020
你好,这是 taro 的问题,目前可以通过以下写法绕过,不用自行配置 esModule 配置 <template>
<view class="index">
<text>{{ msg }}</text>
<image :src="banner"></image>
</view>
</template>
<script>
import banner from '../../resource/banner.png'
import './index.scss'
export default {
data () {
return {
msg: 'Hello world!',
banner
}
}
}
</script>
|
luckyadam
added a commit
that referenced
this issue
Oct 20, 2020
20 tasks
#7872 这个 pr 将修复这个问题,版本发布后可以支持直接使用 src 引用图片 |
好的 |
现在我用taro+react+taroui+ts,也是h5,也是有这个问题。还没更新,希望能解决。谢谢。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
相关平台
H5
复现仓库
https://github.com/netzhouxiang/taro_test
浏览器版本: Chrome
使用框架: Vue 2
复现步骤
1.按步骤创建(Vue2 TypeScript Sass)项目,使用默认模板
2.添加src/resource文件夹(包含banner图片),修改pages/index/index,增加image标签引入图片../../resource/banner.png
3.直接npm run dev:h5;浏览器不显示
4.如果配置h5: {imageUrlLoaderOption: {esModule: false}},则tabbar图标又不显示
期望结果
正常显示图片
实际结果
不显示图片
环境信息
补充信息
有没有可能是node版本导致,我最近做区块链给node降级了,降到 v10.11.0 了
The text was updated successfully, but these errors were encountered: