import REACT, { use, useEffect } from 'react' import { Loader2 } from 'lucide-react'; import { WeatherCard } from './WeatherCard' import { useWeatherstore } from './WeatherStore' import { toast } from 'sonner' export function meta() { return [ { title: "天气查询页面" }, { name: "description", content: "查询天气信息" } ] } export default function Weather() { const { currentWeather, isLoading, error, seterror } = useWeatherstore() useEffect(() => { if (error) { toast.error(error) seterror("") } }, [error, seterror]) return (

天气查询

实时天气

{isLoading && !currentWeather && (

加载中...

)} {!isLoading || currentWeather ? (
) : null}
) }