<template><el-table:data="tableData"style="width: 100%"><el-table-columnprop="date"label="Date"width="180"/><el-table-columnprop="name"label="Name"width="180"/><el-table-columnprop="address"label="Address"/></el-table></template><scriptlang="ts"setup>javascript">
const tableData =[{date:'2016-05-03',name:'Tom',address:'No. 189, Grove St, Los Angeles',},{date:'2016-05-02',name:'Tom',address:'No. 189, Grove St, Los Angeles',},{date:'2016-05-04',name:'Tom',address:'No. 189, Grove St, Los Angeles',},{date:'2016-05-01',name:'Tom',address:'No. 189, Grove St, Los Angeles',},]</script>
8.展示效果
9.axios使用封装流程
下载axios
javascript">npm i axios
封装axios
javascript">import axios from'axios';// 创建一个 Axios 实例const apiClient = axios.create({baseURL:'http://localhost:8083',// 设置你的API基础URLtimeout:5000,// 根据需要调整超时时间headers:{'Content-Type':'application/json',},});// 定义通用的请求方法exportfunctionrequest({ method, url, data =null}){returnapiClient({method,url,data}).then(response=> response.data).catch(error=>{console.error(`There was an error with the ${method.toUpperCase()} request to ${url}:`, error);throw error;});}// 定义具体的请求函数exportfunctionget(url){returnrequest({method:'get', url });}exportfunctionpost(url, data){returnrequest({method:'post', url, data });}exportfunctionput(url, data){returnrequest({method:'put', url, data });}exportfunctiondeleteRequest(url){returnrequest({method:'delete', url });}
完整代码:
import getpass
import os
from langchain.chat_models import init_chat_model
from langchain_core.tools import tool
from langchain_core.messages import HumanMessage, ToolMessage,SystemMessage# 如果没有设置 GROQ_API_KEY,则提示用…
使用 uniapp 开发 H5 应用时,若后端没有配置请求域名白名单则接口会出现 CORS 跨域问题,示例如下:
Access to XMLHttpRequest at http://www.baidu.cn/api/login from origin http://localhost:5054 has been blocked by CORS policy: Reque…