Home  >  Article  >  Web Front-end  >  Solve the problem that Vue.js 2.0 sometimes fails to bind the img src attribute in two directions

Solve the problem that Vue.js 2.0 sometimes fails to bind the img src attribute in two directions

亚连
亚连Original
2018-05-30 15:14:332207browse

Below I will share with you an article that solves the problem that Vue.js 2.0 sometimes fails to bind the img src attribute in two directions. It has a good reference value and I hope it will be helpful to everyone.

Incorrect usage:

<img src="http:0.0.0.127/{{item.imgname}}" alt="">

Correct usage:

<img src="&#39;http:0.0.0.127/&#39;+item.imgname" alt="">

When binding attributes, add in front:

The value of the attribute can use expressions, but pay attention to the characters When splicing strings, you must add quotation marks

. The above is what I compiled for everyone. I hope it will be helpful to everyone in the future.

Related articles:

Simple example of Vue implementing search and news list functions

##axios sends post request and submits image type Form data method

Using axios method in vue component

The above is the detailed content of Solve the problem that Vue.js 2.0 sometimes fails to bind the img src attribute in two directions. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn