我正在使用Material-UI React Drawer。有没有办法让抽屉限制在页面的特定部分而不是占据整个窗口?我试过给根组件一个绝对位置而不是固定位置,但这不会改变抽屉的位置。
<div className="confirmation-drawer">
<Drawer
anchor="top"
open={state.top}
onClose={toggleDrawer('top', false)}>
<!-- Drawer content goes here -->
</Drawer>
</div>
Run Code Online (Sandbox Code Playgroud)
我需要.confirmation-drawerdiv内的抽屉而不是整个页面。任何帮助将不胜感激。
/static/js我的nextjs应用程序中有这个外部 hotjar 脚本。
(function(h,o,t,j,a,r){
h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
h._hjSettings={hjid:<SITEID>,hjsv:6};
a=o.getElementsByTagName('head')[0];
r=o.createElement('script');r.async=1;
r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
a.appendChild(r);
})(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');
Run Code Online (Sandbox Code Playgroud)
我已经从像这样的Head部分中将此文件导入到我的应用程序中_document.js:
<script src={'/js/hotjar.js'} ></script>
问题:
我的 Nextjs 应用程序当前正在临时和实时环境中运行,我想为两者添加一个脚本。上面脚本的唯一动态部分是SITEID这里的值h._hjSettings={hjid:<SITEID>,hjsv:6};。SITEID由于此脚本在客户端运行,我如何为配置文件中的不同环境添加不同的s 并动态更改此值?