如何使用变量而不是“禁用”词禁用字段集

问题描述

我学习了 React JavaScript,现在遇到了这个问题。

阅读w3schools about fieldsset

我想在这代码中使用 currentEditableFile 如果设置 fieldset = enabled 是正确的,但它不能使用三元,如您在此处看到的:

<fieldset className={classes.tagssList} {currentEditableFile ? enabled: disabled}>
        <legend>Select Tags to include</legend>
        {tagsList.map(skill => (
            <button
                className="btn btn-warning btn-sm"
                disabled={false}
                key={skill}
                type="button"
                onClick={() => (currentEditableFile ? onSaveTag(skill) : null)}
            >
                {skill}
            </button>
        ))}
    </fieldset>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)