Vue picture display two-way binding problem

vue uses : src= ".. /.. / assets/"+cards+".png"" cannot display the picture. The Elements result is shown in figure: . However, the address in the Elements in the web page shows that the splicing is correct .. / assets/card1.png . Copy the address in Elements into the code to display the correct picture.
what is the first method that does not display the correct picture? Ask the great god for an answer.


images that are not directly referenced are placed outside the static folder, and then use / static/. to reference


try using require. First make sure that the path reference address is correct, in the following form:

:src=require("'../../assets/'+cards+'.png'")

'.. /.. / assets/'+cards+'.png' just assign this paragraph to a variable in vue and put it in,: src.


there are several ways:
https://codeshelper.com/q/10.

"
Menu