<template> <view class='commodity-List'> <Commodity :dataList:'commodityList'></Commodity> </view> </template> <script> import Commodity from './Commodity.vue' export default { data() { return { commodityList: [{ id: 1, imgUrl: "../../static/img/格子衫.webp", name: "便宜大衣快来买啦,不买后悔呀!为了不后悔,一定要买呀!!!", pprice: "299", oprice: "466", discount: "5.6折" }, { id: 2, imgUrl: "../../static/img/短袖.jpg", name: "便宜大衣快来买啦,不买后悔呀!为了不后悔,一定要买呀!!!", pprice: "299", oprice: "466", discount: "5.6折" }] } },,uniapp报错
时间: 2023-07-21 13:07:15 浏览: 85
根据提供的代码片段,我注意到脚本部分存在一个额外的逗号(,)。请尝试移除最后一个逗号,并再次运行代码。以下是修正后的代码:
```javascript
<template>
<view class='commodity-List'>
<Commodity :dataList='commodityList'></Commodity>
</view>
</template>
<script>
import Commodity from './Commodity.vue'
export default {
data() {
return {
commodityList: [{
id: 1,
imgUrl: "../../static/img/格子衫.webp",
name: "便宜大衣快来买啦,不买后悔呀!为了不后悔,一定要买呀!!!",
pprice: "299",
oprice: "466",
discount: "5.6折"
}, {
id: 2,
imgUrl: "../../static/img/短袖.jpg",
name: "便宜大衣快来买啦,不买后悔呀!为了不后悔,一定要买呀!!!",
pprice: "299",
oprice: "466",
discount: "5.6折"
}]
}
}
}
</script>
```
请尝试更新代码并重新运行,看看问题是否得到解决。如果问题仍然存在,请提供详细的错误信息以便更好地帮助您解决问题。
阅读全文