vue-pre icon indicating copy to clipboard operation
vue-pre copied to clipboard

this. not working inside javascript expressions

Open SimonBackx opened this issue 5 years ago • 0 comments

In vue you can do:

<h1>{{ this.shared.merchant_type == 'small' ? tli(6617, 'Get more customers!', 'Title on the merchant page landing page for small companies') : tli(6618, 'Get more customers!', 'Title on the merchant page landing page for big companies') }}</h1>

This does work in vue, but not in vue pre since it won't recognise the variable this and evaluate to undefined, always returning false.

This fix is this, but this is a hidden bug that can cause unexpected behaviour. So it's better to get this fixed or throw a warning/error. <h1>{{ shared.merchant_type == 'small' ? tli(6617, 'Get more customers!', 'Title on the merchant page landing page for small companies') : tli(6618, 'Get more customers!', 'Title on the merchant page landing page for big companies') }}</h1>

SimonBackx avatar Nov 19 '19 09:11 SimonBackx