国产xxxx99真实实拍_久久不雅视频_高清韩国a级特黄毛片_嗯老师别我我受不了了小说

資訊專欄INFORMATION COLUMN

html標簽屬性為布爾值

impig33 / 886人閱讀

摘要:后來在參考到了答案總結起來就是這樣在不使用框架處理的情況下,給標簽如下幾種寫法,都會使按鈕不可點擊任意字符串要讓不可點擊的按鈕,回到點擊狀態有兩種方式通過移除屬性通過賦值參考資料鏈接鏈接

在開發公司的一個內部系統時,用到了AntDesign框架。我要讓Button在可點擊和不可點擊兩種狀態之間切換。

結果我的Button標簽確實不可點擊了,但是eslint卻報錯如下:

error    Value must be omitted for boolean attributes  react/jsx-boolean-value

后來把代碼給成這樣:

eslint報錯就消失了。

后來在Stack Overflow參考到了答案:

2.5.2 Boolean attributes

A number of attributes are boolean attributes. The presence of a boolean attribute on an element represents the true value, and the absence of the attribute represents the false value.

If the attribute is present, its value must either be the empty string or a value that is an ASCII case-insensitive match for the attribute"s canonical name, with no leading or trailing whitespace.

The values "true" and "false" are not allowed on boolean attributes. To represent a false value, the attribute has to be omitted altogether.

*Note that this means that

閱讀需要支付1元查看
<