成人无码视频,亚洲精品久久久久av无码,午夜精品久久久久久毛片,亚洲 中文字幕 日韩 无码

資訊專欄INFORMATION COLUMN

html標(biāo)簽屬性為布爾值

impig33 / 942人閱讀

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

在開發(fā)公司的一個(gè)內(nèi)部系統(tǒng)時(shí),用到了AntDesign框架。我要讓Button在可點(diǎn)擊和不可點(diǎn)擊兩種狀態(tài)之間切換。

結(jié)果我的Button標(biāo)簽確實(shí)不可點(diǎn)擊了,但是eslint卻報(bào)錯(cuò)如下:

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

后來把代碼給成這樣:

eslint報(bào)錯(cuò)就消失了。

后來在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元查看
<