How to make input read only based on particular value in Vue?

Please note that, according to HTML specs, the select tag in HTML doesn’t have a readonly attribute.

However, in general case, I’d go with something like this:

<input class="form-control" id="selectCategory" :readonly="cat_id >= 1">

Basically, the documentation says that if an attribute value evaluates to false, then the attribute being omitted. See here for further details.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)