I have a code snippet in Vue.js that displays a certain value.
<dl>
<!-- Fan speed -->
<dt>{{ $t('pageInventory.table.fanSpeed') }}:</dt>
<dd>{{ dataFormatter(item.speed) }}</dd>
</dl>
If the value is -1, I want to display 0 instead. I tried writing it in C style but encountered a compilation error.
<dd>{{ (item.speed != -1) ? dataFormatter(item.speed) : dataFormatter('0') }}</dd>
However, I received this error message:
error Replace {{·dataFormatter((item.speed·!=·-110)·?·item.speed·:·'0')·}} with ⏎··················{{·dataFormatter(item.speed·!=·-110·?·item.speed·:·'0')·}}⏎················
Could someone please advise me on the correct way to write this code?