我尝试过使用这个github源码而不使用fullpage.js的react-fullpage特性
source
根据代码和演示,右边应该有一个虚线导航栏,其中引用当前屏幕的点将被突出显示,并单击任何点进入特定屏幕。但我在屏幕上看不到。不知道为什么它不见了,也不知道我遗漏了什么道具。请在这方面帮帮我。
我的代码:
import React, { Component } from "react";
// @ts-ignore
import Fullpage, { FullPageSections, FullpageSection } from '@ap.cx/react-fullpage';
export default class Home extends Component {
public render () {
return (
<Fullpage>
<FullPageSections>
<FullpageSection style={{
backgroundColor: 'green',
height: '100vh',
padding: '10em',
}}>1</FullpageSection>
<FullpageSection style={{
backgroundColor: 'blue',
padding: '10em',
}}></FullpageSection>
<FullpageSection style={{
backgroundColor: 'firebrick',
padding: '10em',
}}>3</FullpageSection>
<FullpageSection style={{
backgroundColor: 'pink',
padding: '10em',
}}>4</FullpageSection>
<FullpageSection style={{
backgroundColor: 'coral',
padding: '10em',
}}>5</FullpageSection>
</FullPageSections>
<button onClick={() => window.scrollTo(0,0)} style={{
position: 'fixed',
right:50,
bottom: 30
}}>
Top</button>
</Fullpage>
)
}}发布于 2020-06-26 16:20:34
为div封闭的导航栏提供一些z索引值。看起来不错。如果react中的代码:-
<div style={{zIndex:1000}}>
<Navbar>
......
......
</Navbar>
</div>https://stackoverflow.com/questions/58854578
复制相似问题