我正试图在我正在制作的购物车中显示图像,但它没有显示出来.我必须导入每个图像吗?我知道我的路径很好,因为它之前有用.我认为我的product.js文件可能有问题,但我无法理解.
这是我的Product.js
import React, { Component, PropTypes } from 'react';
class Product extends Component {
handleClick = () => {
const { id, addToCart, removeFromCart, isInCart } = this.props;
if (isInCart) {
removeFromCart(id);
} else {
addToCart(id);
}
}
render() {
const { name, price, currency, image, url, isInCart } = this.props;
return (
<div className="product thumbnail">
<img src={image} alt="product" />
<div className="caption">
<h3>
<a href={url}>{name}</a>
</h3>
<div className="product__price">{price} {currency}</div>
<div className="product__button-wrap">
<button
className={isInCart ? 'btn btn-danger' : 'btn btn-primary'} …Run Code Online (Sandbox Code Playgroud) 我在App.vue工具栏中不断收到此错误。
[Vue警告]:道具无效:道具“ scrollThreshold”的类型检查失败。>预期数字,得到字符串。
<v-toolbar dark color="pink darken-4"
class="toolbar"
flat
fixed
scroll-off-screen
scroll-threshold=500>
</v-toolbar>
Run Code Online (Sandbox Code Playgroud)
我将scrollThreshold更改为“ 500”,并且错误相同。