【问题标题】:Reactjs, How to include component that in cloud database?Reactjs,如何在云数据库中包含组件?
【发布时间】:2021-07-31 23:10:36
【问题描述】:

我最近才学习 ReactJS,我需要你的帮助! 我从事一个 ReactJS 项目,该项目具有存储在其他数据库中的页眉内容和页脚。 所以我现在要做的就是将 Header、Content 和 Footer 组件放入我的 App.js 并编译它。 有没有办法可以在云中获取内容并将其包含到我的 reactjs 中?

我希望它像它看起来的那样工作......

import React from 'react';   
import Header from "https://example.com/component/Header.js";

function App() {   
  return (  
    <>  
     <Header/>
    </>  
  );
}

export default App;

【问题讨论】:

    标签: reactjs import components include


    【解决方案1】:

    react 的一个特点是它可以导入文档 src 中的文件 它是

    从“反应”导入反应;

    从“../component/Header”导入页眉;

    【讨论】:

      猜你喜欢
      • 2019-05-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-23
      • 2020-02-05
      • 1970-01-01
      • 2015-02-05
      • 1970-01-01
      相关资源
      最近更新 更多