Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 导入&x27;和';出口';可能仅出现在顶层。但它是在最高层和最高层。(盖茨比&;J)_Reactjs_Angular_Gatsby_Yarnpkg - Fatal编程技术网

Reactjs 导入&x27;和';出口';可能仅出现在顶层。但它是在最高层和最高层。(盖茨比&;J)

Reactjs 导入&x27;和';出口';可能仅出现在顶层。但它是在最高层和最高层。(盖茨比&;J),reactjs,angular,gatsby,yarnpkg,Reactjs,Angular,Gatsby,Yarnpkg,我正在创建一个登录页,我有一个简单的错误,但我无法在我的代码中找到原因。对我来说,这个组件是绝对合乎逻辑的,并且与其他组件的结构相同 基于此组件,我当前收到以下错误: ./src/sections/landing/Prices.js Module Error (from ./node_modules/eslint-loader/index.js): C:\XXXXXXX\xxx-gatsby-1.4\xxx-gatsby\src\sections\landing\Prices.js 232

我正在创建一个登录页,我有一个简单的错误,但我无法在我的代码中找到原因。对我来说,这个组件是绝对合乎逻辑的,并且与其他组件的结构相同

基于此组件,我当前收到以下错误:

./src/sections/landing/Prices.js
Module Error (from ./node_modules/eslint-loader/index.js):

C:\XXXXXXX\xxx-gatsby-1.4\xxx-gatsby\src\sections\landing\Prices.js
  232:1  error  Parsing error: 'import' and 'export' may only appear at the top level

  230 | };
  231 | 
> 232 | export default Content;
      | ^
  233 | 

✖ 1 problem (1 error, 0 warnings)
我的代码:

import React, { useContext } from "react";

import { Container, Row, Col } from "react-bootstrap";
import GlobalContext from "../../context/GlobalContext";
import imgC from "../../assets/image/l2/jpg/l2-content2-img.jpg";

const Content = () => {
  const gContext = useContext(GlobalContext);

const Pricing1 = () => {
  const [isMonthly, setIsMonthly] = useState(false);

  return (
    <>
      {/* <!-- Content Area --> */}
      <div className="content-section2 pt-12 pb-9 pt-lg-21 pb-lg-25 bg-default-2">
        <Container>
          <Row className="justify-content-center">
            <Col xl="6" lg="8" sm="10">
              <div className="section-title text-center mb-12 mb-lg-17">
                <h2 className="title gr-text-4 mb-7">
                  Pricing &amp; Plans
                </h2>
                <p className="gr-text-8 px-lg-7 px-xl-0">
                  With lots of unique blocks, you can easily build a page
                  without coding. Build your next landing page.
                </p>
              </div>
            </Col>
          </Row>
        </Container>
        <Container>
            <div className="text-center pt-9">
              <div
                className="mb-13 d-inline-flex position-relative"
                id="pricing-dynamic-deck--head"
              >
                <span className="period month gr-text-8 gr-text-color ">
                  Monthly
                </span>
                <a
                  href="/#"
                  className={`btn-toggle mx-3 price-deck-trigger ${
                    isMonthly ? "" : "active"
                  }`}
                  onClick={(e) => {
                    e.preventDefault();
                    setIsMonthly(!isMonthly);
                  }}
                >
                  <span className="round"></span>
                </a>
                <span className="period year gr-text-8 gr-text-color">
                  Yearly
                </span>
                <span className="badge gr-badge text-primary gr-text-12 gr-bg-blue-opacity-1 rounded-pill ml-5 text-uppercase">
                  Save 25%
                </span>
              </div>
              <Row className="justify-content-center">
                <Col lg="4" md="6" sm="10" className="mb-9">
                  <div className="pricing-card bg-white gr-hover-shadow-1 border text-left pt-9 pb-9 pr-9 pr-xl-13  pl-9 pl-xl-13 bg-white rounded-10">
                    <div className="price-content">
                      <span className="small-title gr-text-12 text-primary font-weight-bold text-uppercase">
                        Starter
                      </span>
                      <div className="d-flex align-items-end mt-11 ">
                        <span className="currency mr-2 gr-text-6 font-weight-bold line-spacing-none text-blackish-blue">
                          $
                        </span>
                        <h2 className="price-value gr-text-2 font-weight-bold line-spacing-none mb-0 text-blackish-blue">
                          {isMonthly ? "49" : "19"}
                          <span className="d-none">.</span>
                        </h2>
                        <span className="per gr-text-9 text-blackish-blue">
                          /month
                        </span>
                      </div>
                      <span className="price-bottom-text gr-text-11 mt-5 text-blackish-blue gr-opacity-7 d-inline-flex">
                        {isMonthly ? "billed monthly" : "billed yearly"}
                      </span>
                      <ul className="card-list list-style-check pl-0 mt-7 mt-lg-11">
                        <li className="gr-text-9">
                          <i className="icon icon-check-simple"></i>Commercial
                          License
                        </li>
                        <li className="gr-text-9">
                          <i className="icon icon-check-simple"></i>100+ HTML UI
                          Elements
                        </li>
                        <li className="gr-text-9">
                          <i className="icon icon-check-simple"></i>Unlimited
                          Domain Support
                        </li>
                        <li className="disabled gr-text-9">
                          <i className="icon icon-simple-remove"></i>6 months
                          premium support
                        </li>
                        <li className="disabled gr-text-9">
                          <i className="icon icon-simple-remove"></i>Lifetime
                          updates
                        </li>
                      </ul>
                    </div>
                    <Button className="with-icon gr-hover-y px-xl-8 px-lg-4 px-sm-8 px-4">
                      Start Free Trial
                      <i className="icon icon-tail-right font-weight-bold"></i>
                    </Button>
                    <span className="btn-bottom-text d-block gr-text-11 text-blackish-blue gr-opacity-7 mt-5">
                      No credit card required
                    </span>
                  </div>
                </Col>
                <Col lg="4" md="6" sm="10" className="mb-9">
                  <div className="pricing-card bg-white gr-hover-shadow-1 border text-left pt-9 pb-9 pr-9 pr-xl-13  pl-9 pl-xl-13 bg-white rounded-10">
                    <div className="price-content">
                      <span className="small-title gr-text-12 text-primary font-weight-bold text-uppercase">
                        Standard
                      </span>
                      <div className="d-flex align-items-end mt-11 ">
                        <span className="currency mr-2 gr-text-6 font-weight-bold line-spacing-none text-blackish-blue">
                          $
                        </span>
                        <h2 className="price-value gr-text-2 font-weight-bold line-spacing-none mb-0 text-blackish-blue">
                          {isMonthly ? "99" : "49"}
                          <span className="d-none">.</span>
                        </h2>
                        <span className="per gr-text-9 text-blackish-blue">
                          /month
                        </span>
                      </div>
                      <span className="price-bottom-text gr-text-11 mt-5 text-blackish-blue gr-opacity-7 d-inline-flex">
                        {" "}
                        {isMonthly ? "billed monthly" : "billed yearly"}
                      </span>
                      <ul className="card-list list-style-check pl-0 mt-7 mt-lg-11">
                        <li className="gr-text-9">
                          <i className="icon icon-check-simple"></i>Commercial
                          License
                        </li>
                        <li className="gr-text-9">
                          <i className="icon icon-check-simple"></i>100+ HTML UI
                          Elements
                        </li>
                        <li className="gr-text-9">
                          <i className="icon icon-check-simple"></i>Unlimited
                          Domain Support
                        </li>
                        <li className="gr-text-9">
                          <i className="icon icon-check-simple"></i>6 months
                          premium support
                        </li>
                        <li className="disabled gr-text-9">
                          <i className="icon icon-simple-remove"></i>Lifetime
                          updates
                        </li>
                      </ul>
                    </div>
                    <Button className="with-icon gr-hover-y px-xl-8 px-lg-4 px-sm-8 px-4">
                      Start Free Trial
                      <i className="icon icon-tail-right font-weight-bold"></i>
                    </Button>
                    <span className="btn-bottom-text d-block gr-text-11 text-blackish-blue gr-opacity-7 mt-5">
                      No credit card required
                    </span>
                  </div>
                </Col>
                <Col lg="4" md="6" sm="10" className="mb-9">
                  <div className="pricing-card bg-white gr-hover-shadow-1 border text-left pt-9 pb-9 pr-9 pr-xl-13  pl-9 pl-xl-13 bg-white rounded-10">
                    <div className="price-content">
                      <span className="small-title gr-text-12 text-primary font-weight-bold text-uppercase">
                        Premium
                      </span>
                      <div className="d-flex align-items-end mt-11">
                        <span className="currency mr-2 gr-text-6 font-weight-bold line-spacing-none text-blackish-blue">
                          $
                        </span>
                        <h2 className="price-value gr-text-2 font-weight-bold line-spacing-none mb-0  text-blackish-blue">
                          {isMonthly ? "129" : "99"}
                          <span className="d-none">.</span>
                        </h2>
                        <span className="per gr-text-9 text-blackish-blue">
                          /month
                        </span>
                      </div>
                      <span className="price-bottom-text gr-text-11 mt-5 text-blackish-blue gr-opacity-7 d-inline-flex">
                        {" "}
                        {isMonthly ? "billed monthly" : "billed yearly"}
                      </span>
                      <ul className="card-list list-style-check pl-0 mt-7 mt-lg-11">
                        <li className="gr-text-9">
                          <i className="icon icon-check-simple"></i>Commercial
                          License
                        </li>
                        <li className="gr-text-9">
                          <i className="icon icon-check-simple"></i>100+ HTML UI
                          Elements
                        </li>
                        <li className="gr-text-9">
                          <i className="icon icon-check-simple"></i>Unlimited
                          Domain Support
                        </li>
                        <li className="gr-text-9">
                          <i className="icon icon-check-simple"></i>6 months
                          premium support
                        </li>
                        <li className="gr-text-9">
                          <i className="icon icon-check-simple"></i>Lifetime
                          updates
                        </li>
                      </ul>
                    </div>
                    <Button className="with-icon gr-hover-y px-xl-8 px-lg-4 px-sm-8 px-4">
                      Start Free Trial
                      <i className="icon icon-tail-right font-weight-bold"></i>
                    </Button>
                    <span className="btn-bottom-text d-block gr-text-11 text-blackish-blue gr-opacity-7 mt-5">
                      No credit card required
                    </span>
                  </div>
                </Col>
              </Row>
            </div>
          </Container>

      </div>
      
    </>
  );
};

export default Content;
import React,{useContext}来自“React”;
从“react bootstrap”导入{Container,Row,Col};
从“../../context/GlobalContext”导入GlobalContext;
从“../../assets/image/l2/jpg/l2-content2-img.jpg”导入imgC;
常量内容=()=>{
const gContext=useContext(GlobalContext);
常数Pricing1=()=>{
const[isMonthly,setIsMonthly]=useState(false);
返回(
{/*  */}
定价与计划

使用许多独特的块,您可以轻松构建页面 无需编码。构建下一个登录页。

月刊 每年 节省25% 开胃菜 $ {每月?“49”:“19”} . /月 {isMonthly?“按月计费”:“每年计费”}
  • 商业的 许可证
  • 100+HTML用户界面 元素
  • 无限的 域支持
  • 6个月 高级支持
  • 一生 更新
开始免费试用 不需要信用卡 标准 $ {每月?“99”:“49”} . /月 {" "} {isMonthly?“按月计费”:“每年计费”}
  • 商业的 许可证
  • 100+HTML用户界面 元素
  • 无限的 域支持
  • 6个月 高级支持
  • 一生 更新
开始免费试用 不需要信用卡 保险费 $ {每月?“129”:“99”} . /月 {" "} {isMonthly?“按月计费”:“每年计费”}
  • 商业的 许可证
  • 100+HTML用户界面 元素
  • const Content = () => {
      const gContext = useContext(GlobalContext);
    
      const Pricing1 = () => {
        const [isMonthly, setIsMonthly] = useState(false);
    
        return (
          <>
            <content..../>
          </>
        );
      };
    }
    export default Content;