繁体   English   中英

为什么我的nextjs项目中onLoad里面的function没有执行

[英]Why does the function inside onLoad not execute in my nextjs project

我在 nextjs.org 上学习 nextjs 并做了我在教程中阅读的内容,但它不起作用。 ....为什么 onLoad 里面的 function 没有执行?

 import Link from 'next/link'; import Head from 'next/head'; import Script from 'next/script'; const FirstPost = () => { return ( < div > < Head > < title > BlogPost < /title> < Script src = "https://connect.facebook.net/en_US/sdk.js" strategy = "lazyOnload" onLoad = { () => { console.log("script loaded successfully"); } } /> < /Head> < h3 > first blog post in my next.js project < /h3> < Link href = "/" > < h2 > Go home < /h2></Link > < /div> ) } export default FirstPost;

本文暂无回复,试试以下方法:

为什么我的nextjs项目中onLoad里面的function没有执行

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2023 STACKOOM.COM