我已经使用以下命令安装了 TypeORM:
npm i --save @nestjs/typeorm typeorm
up to date, audited 855 packages in 3s
86 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
Run Code Online (Sandbox Code Playgroud)
但当我想使用@nestjs/typeorm它时,它说“找不到模块”。
main.ts:
import 'dotenv/config';
import {Logger} from '@nestjs/common';
import {NestFactory} from '@nestjs/core';
import {AppModule} from './app.module';
import {TypeOrm} from '@nestjs/typeorm';
const port = process.env.PORT || 3000;
async function bootstrap() {
const app = await NestFactory.create(AppModule);
await app.listen(port);
Logger.log(`server started on ${port}`, 'Bootstrap');
}
bootstrap();
Run Code Online (Sandbox Code Playgroud)
错误:
import …Run Code Online (Sandbox Code Playgroud) 我创建了一个加载器动画我已经安装了 lottie.js 然后我下载了 loader.json 文件然后我创建了这样的组件 ActivityIndicatior
import React from "react";
import LottieView from "lottie-react-native";
function ActivityIndicator({ visible = false }) {
if (!visible) return null;
return (
<LottieView autoPlay loop source={require("../animation/loader.json")} />
);
}
export default ActivityIndicator;
Run Code Online (Sandbox Code Playgroud)
然后我在列表屏幕中导入它并定义它 const [loading, setLoading] = useState(false);
export default function ListingsScreens({ navigation }) {
const [listings, setListing] = useState([]);
const [error, setError] = useState(false);
const [loading, setLoading] = useState(false);
useEffect(() => {
loadListings();
}, []);
const loadListings = async () => {
setLoading(true);
const …Run Code Online (Sandbox Code Playgroud)