パブリックメソッドVUEの画像が示すように、もし通常の表示画面、そうでない場合は、デフォルトの画像

1.html

<IMG:SRC = "imgShow(imgUrl)" /> 

2.js

//表示画像、通常の表示画像であれば、しない場合は、デフォルトの画像
 データ()    
     imgUrl: ''、
mothods:
imgShow:機能(データ){ REG = / ^(HTTPS:| HTTP:)させ/ G; IF(データ){ IF(reg.test(データ)){ 戻りデータ; }他{ リターン「http://192.168.0.176:8888/assets/img/item4.png」。 } }他{ リターン'http://192.168.0.176:8888/assets/img/404.png'。 } }

 

おすすめ

転載: www.cnblogs.com/dyy-dida/p/11511127.html