1. 图片
把图片放在/static/文件夹中,在component中用img tag:
<img src={'../static/icon.png'} />
2. css
把css文件放在/static/文件夹中,在pages/index.js中添加Head和link:
import Head from 'next/head'
class HomePage extends React.Component { render() { return ( <div> <Head> <link href="/static/style.css" rel="stylesheet" /> </Head>
</div>
)
}
}