<template>
<view>
<view v-for="(product, index) in products" :key="index" class="product-item">
<text>{{ product.name }}</text>
<text>{{ product.price }}</text>
</view>
</view>
</template>
<script>
export default {
data() {
return {
products: [
{ name: '商品1', price: '100元' },
{ name: '商品2', price: '200元' },
{ name: '商品3', price: '300元' }
]
};
}
};
</script>
<style>
.product-item {
margin-bottom: 10px;
}
</style>
此段代码在hbuilder x 4.44版本上创建uniapp项目,勾选uni-app x 选择vue3,浏览器运行正常,云打包到android报错,如下:
Appid: UNI10D4AA1
e: file://[PackagePath]/wgtRoot/UNI10D4AA1/.uniappx/android/src/pages/index/index.kt:26:78 Unresolved reference: name
e: file://[PackagePath]/wgtRoot/UNI10D4AA1/.uniappx/android/src/pages/index/index.kt:27:78 Unresolved reference: price
FAILURE: Build failed with an exception.
0 个回复