【问题标题】:SQlite data on to a table using Axios使用 Axios 将 SQlite 数据写入表
【发布时间】:2022-01-11 01:06:28
【问题描述】:
import React, {useState} from "react";
import axios from 'axios';

function TreatmentRecordPanel() {

const [treatId, setID] = React.useState('');
const [treatCourseId, setCourse] = 
React.useState('');
const [type, setType] = React.useState('');
const [category, setCatagory] = 
React.useState('');
const [Pname, setName] = React.useState('');
const [startDate, setDate] = 
React.useState('');




function patientTreatmentRecord(){




axios.get(`http://localhost:8080/GetAllPatients`)
 .then( (response) => {

var resData = response.data;
let data = JSON.stringify(resData);
window.alert("Response recieved from server = " + data);

});
}

我正在创建一个反应应用程序,我必须使用 SQlite 将患者的数据存储在本地数据库中。我希望表格中的数据显示在表格上。我该如何从这里开始。任何帮助都将不胜感激。

【问题讨论】:

    标签: javascript reactjs sqlite axios


    【解决方案1】:

    创建一个函数,该函数将生成以数据为参数的表。在 axios 请求后,我将删除 DOM 中的表,然后使用该函数重新创建它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-07-02
      • 1970-01-01
      • 2013-05-05
      • 2018-05-16
      • 2015-11-07
      • 1970-01-01
      • 1970-01-01
      • 2017-01-17
      相关资源
      最近更新 更多