gpt4 book ai didi

javascript - ReactJs 字符串必须带有单引号

转载 作者:行者123 更新时间:2023-12-01 00:12:17 24 4
gpt4 key购买 nike

我正在尝试在我的 React 应用程序上安装react-multi-carousel。我遇到一些错误,例如:

Line 1:34: Strings must use singlequote quotes Line 2:22:
Strings must use singlequote quotes Line 3:8: Strings must use singlequote quotes Line 36:53: Strings must use singlequote quotes Line 42:43: Strings must use singlequote quotes Line 42:53: Strings must use singlequote quotes

这是我的代码。

import React, { Component } from "react";
import Carousel from "react-multi-carousel";
import "react-multi-carousel/lib/styles.css";


class GameList extends Component {

render() {

const responsive = {
desktop: {
breakpoint: { max: 3000, min: 1024 },
items: 3,
slidesToSlide: 3, // optional, default to 1.
},
tablet: {
breakpoint: { max: 1024, min: 464 },
items: 2,
slidesToSlide: 2, // optional, default to 1.
},
mobile: {
breakpoint: { max: 464, min: 0 },
items: 1,
slidesToSlide: 1, // optional, default to 1.
},
};

return (
<Carousel
swipeable={false}
draggable={false}
showDots={true}
responsive={responsive}
ssr={true}
infinite={true}
autoPlay={this.props.deviceType !== "mobile" ? true : false}
autoPlaySpeed={1000}
keyBoardControl={true}
customTransition="all .5"
transitionDuration={500}
containerClass="carousel-container"
removeArrowOnDeviceType={["tablet", "mobile"]}
deviceType={this.props.deviceType}
dotListClass="custom-dot-list-style"
itemClass="carousel-item-padding-40-px"
>
<div>Item 1</div>
<div>Item 2</div>
<div>Item 3</div>
<div>Item 4</div>
</Carousel>

);
}
}
export default GameList

最佳答案

这是一个 es-lint 警告。您可以在 es-lint 配置文件 (.eslintrc) 中修复该问题。

"rules": {
"quotes": [2, "single", { "avoidEscape": true }]
}

关于javascript - ReactJs 字符串必须带有单引号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59991181/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com