简体   繁体   English

如何禁用 InputRadioGroup?

[英]How to disable InputRadioGroup?

Is there a way to disable InputRadioGroup in blazor webassembly?有没有办法在 blazor webassembly 中禁用 InputRadioGroup?

I tried <InputRadioGroup Disabled="false"> , but that is obviously not working.我尝试<InputRadioGroup Disabled="false"> ,但这显然不起作用。 Any other way?还有别的办法吗?

Wrap the <InputRadioGroup> in a <fieldset> and disable that.<InputRadioGroup>包装在<fieldset>中并禁用它。

<fieldset disabled="@true">
    <InputRadioGroup @bind-Value="answer">
        @foreach (var option in Question.Options)
        {
            <label class="me-3 form-check-label">
                <InputRadio class="form-check-input me-1" Value="@option" />
                @option
            </label>
        }
    </InputRadioGroup>
</fieldset>

The <InputRadioGroup> does not output any HTML. It outputs a CascadingValue CascadingValue<InputRadioContext> and its ChildContent only. <InputRadioGroup>不 output 任何 HTML。它仅输出 CascadingValue CascadingValue<InputRadioContext>及其 ChildContent。

Source Code 源代码

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

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