3

İs that possible to give an attribute like that?

src="${urlPath}/img/icon-{{flight.OperatingAirline._CompanyShortName}}.png"

doesn't works.

2 Answers 2

4

Use :v-bind (or shortcut ":") instead of "{{ }}" : v-bind

So :src="Any javascript here !"

:src="urlPath + '/img/icon-' + flight.OperatingAirline._CompanyShortName + '.png'"

urlPath and flight.OperatingAirline._CompanyShortName must be a javascript variable.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks @SLYcee and I made it available with jstl with a little touch: :src="'${urlPath}/img/icon-' + flight.OperatingAirline._CompanyShortName + '.png'"
1

After edit @SLYcee's answer for JSTL combined solution:

:src="'${urlPath}/img/icon-' + flight.OperatingAirline._CompanyShortName + '.png'"

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.