1、报错 × initialize,开发者工具的端口和运行时的的端口号不一致导致
解决方法:在开发者工具:设置->安全 重新打开一下服务端口号,HBuilder重新运行一下代码
image.png
2、报错 × open IDE,需要配置微信小程序AppID和uni-app应用标识(AppID)
image.png image.png3、uni-app 背景图无法加载本地图片,解决方法动态加载
报错:
image.png
解决方法:
// 方法一:
<template>
<view class="index" :style="{backgroundImage:`url(${indexBackgroundImage})`,backgroundSize: 'cover'}">
<!--你的内容-->
</view>
</template>
<script>
import indexBackgroundImage from "@/static/img/account_index.jpg"
export default {
data() {
return {
indexBackgroundImage:indexBackgroundImage
}
},
methods: {}
}
</script>
// 方法二:
<div :style="{backgroundImage: `url(${require('../../static/img/meeting_bg@2x.png')})`}" class="default-cover"></div>
网友评论