小编Deb*_*ish的帖子

Next Js 动态导入没有 SSR 不起作用

我正在尝试使用这个react-carousel-3d库https://github.com/suhailssulu/react-carousel-3d,但我收到以下错误,因为该库不是为支持SSR而开发的。

`ReferenceError: window is not defined`
at Object.<anonymous> (C:\Deba\Workspace2021\Nextjs\myportfolio\node_modules\3d-react-carousal\dist\index.js:1:255)
Run Code Online (Sandbox Code Playgroud)

现在我尝试使用没有 SSR 的动态导入https://nextjs.org/docs/advanced-features/dynamic-import#with-no-ssr

const {Carousel} = dynamic(
    () => import('../node_modules/3d-react-carousal/src/index.js'),
    { ssr: false }
  )
Run Code Online (Sandbox Code Playgroud)

我现在收到以下错误:

./node_modules/3d-react-carousal/src/index.js 189:12
Module parse failed: Unexpected token (189:12)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
     render() {
        return (
             <div className="react-3d-carousel" style={{ height: this.state.height }}>
                 {this.state.slides && this.state.slides.length > 0 &&
                     <div className="slider-container">
Run Code Online (Sandbox Code Playgroud)

有人可以指出我在这里做错了什么或者关于如何让它工作的任何想法吗?

reactjs server-side-rendering next.js

6
推荐指数
1
解决办法
1万
查看次数

ModuleNotFoundError:找不到模块:错误:无法解析“/vercel/path0/components”中的“../config”

我在通过 vercel 部署 next.js 应用程序时偶然发现了这一点。它在本地使用命令“npm run dev”运行得很好。但是当我尝试通过 vercel 使用 Github 远程存储库部署它时,它会抛出如下错误:

    16:13:16.712    Attention: Next.js now collects completely anonymous telemetry regarding usage.
    16:13:16.712    This information is used to shape Next.js' roadmap and prioritize features.
    16:13:16.712    You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
    16:13:16.712    https://nextjs.org/telemetry
    16:13:20.255    Failed to compile.
    16:13:20.256    ModuleNotFoundError: Module not found: Error: Can't resolve '../config' in '/vercel/path0/components'
    16:13:20.257    > Build error occurred
    16:13:20.257 …
Run Code Online (Sandbox Code Playgroud)

reactjs next.js vercel

6
推荐指数
1
解决办法
9813
查看次数

Xamarin表格检查键盘是否打开

有没有办法检查Xamarin Forms中的键盘是否打开?键盘打开或关闭时是否有任何事件被触发?如果是这样,我在哪里可以找到它的一个例子?

keyboard-events xamarin.android xamarin.forms

5
推荐指数
1
解决办法
4732
查看次数

如何使用自定义渲染器在 Xamarin Forms 中制作带圆角的进度条

我想以 Xamarin 形式显示带圆角的进度条。我能够使用自定义渲染器在 iOS 中做到这一点:

class CustomProgressBarRenderer: ProgressBarRenderer
{
    protected override void OnElementChanged(ElementChangedEventArgs<Xamarin.Forms.ProgressBar> e)
    {
        base.OnElementChanged(e);
        Control.ProgressTintColor = Color.FromRgb(255, 201, 74).ToUIColor();
    }

    public override void LayoutSubviews()
    {
        base.LayoutSubviews();
        var X = 1.0f;
        var Y = 7.0f;
        CGAffineTransform transform = CGAffineTransform.MakeScale(X, Y);
        this.Transform = transform;
        this.ClipsToBounds = true;
        this.Layer.MasksToBounds = true;
        this.Layer.CornerRadius = 5; // This is for rounded corners.
    }
}
Run Code Online (Sandbox Code Playgroud)

如何使用自定义渲染器在 Android 中实现相同的效果。这就是我希望进度条(圆角)的外观。

在此处输入图片说明

custom-renderer xamarin.android progress-bar xamarin xamarin.forms

4
推荐指数
1
解决办法
5581
查看次数

键盘以Xamarin形式隐藏了Hybrd Webview中的Textarea

在xamarin表单中,我使用混合webview来显示texarea和输入字段.当我尝试在textarea中输入一些数据时,键盘会弹出并隐藏textarea.
因此,我无法看到我正在键入的文本.它不会自动滚动到当前光标位置.我已经读过,添加
android:windowSoftInputMode="adjustResize" 到android清单文件就可以了.
但是是否可以将上述属性仅应用于webview(不申请其他视图)?或者是否有其他方法可以自动滚动视图,以便输入字段(光标)位于键盘上方.
请帮忙

android webview xamarin.android xamarin.forms

1
推荐指数
1
解决办法
1466
查看次数

Xamarin Forms 内容页面使背景颜色透明

我有一个要求,我需要在模态弹出页面中显示一个列表。我可以显示一个列表,但我不能使背景颜色透明或半透明,以便它下面的页面部分可见。

我正在使用以下方法从我的视图模型推送页面:

NavigationParameters oNavParams = new NavigationParameters();
oNavParams.Add("Mode", "FeedBack");
oNavParams.Add("selectedItem", txtFeedback);
_navigationService.NavigateAsync("PopupBox", oNavParams);
Run Code Online (Sandbox Code Playgroud)

这是我的 xaml 代码:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:prism="clr-namespace:Prism.Mvvm;assembly=Prism.Forms"
             xmlns:local="clr-namespace:MyApp"
             prism:ViewModelLocator.AutowireViewModel="True"
             x:Class="MyApp.Views.PopupBox">
    <ContentPage.Content>
        <AbsoluteLayout Padding="0" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
            <ContentView x:Name="popupListView" BackgroundColor="Transparent" Padding="10, 0" IsVisible="false" AbsoluteLayout.LayoutBounds="0, 0, 1, 1" AbsoluteLayout.LayoutFlags="All">
                <StackLayout VerticalOptions="Center" HorizontalOptions="Center">
                    <StackLayout Orientation="Vertical" HeightRequest="200" WidthRequest="300" BackgroundColor="White">
                        <ListView x:Name="sampleList">
                        </ListView>
                    </StackLayout>
                </StackLayout>
            </ContentView>
        </AbsoluteLayout>
    </ContentPage.Content>
</ContentPage>
Run Code Online (Sandbox Code Playgroud)

这是我的代码:

  public PopupBox()
        {
            try
            {
                InitializeComponent();
                NavigationPage.SetHasNavigationBar(this, false);
                sampleList.ItemsSource = new List<string>
            {
                "Test ListView",
                "Test ListView",
                "Test ListView", …
Run Code Online (Sandbox Code Playgroud)

custom-renderer modalpopup xamarin.forms

1
推荐指数
1
解决办法
2468
查看次数