Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vue.js/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 使用vue js为图像提供src?_Html_Vue.js_Coldfusion_Riot Games Api - Fatal编程技术网

Html 使用vue js为图像提供src?

Html 使用vue js为图像提供src?,html,vue.js,coldfusion,riot-games-api,Html,Vue.js,Coldfusion,Riot Games Api,因此,我用html创建了一个图像,并尝试为其赋予属性v-bind:src 这是代码行: <img class="summonericon" ref="summonerIcon" v-bind:src="summonerRequests.profileIcon"> CallaugerRequests.profileIcon是我使用coldfusion函数保存的变量: <cffunction name="g

因此,我用html创建了一个图像,并尝试为其赋予属性v-bind:src

这是代码行:

<img class="summonericon" ref="summonerIcon" v-bind:src="summonerRequests.profileIcon">

CallaugerRequests.profileIcon是我使用coldfusion函数保存的变量:

<cffunction name="getSummonerByName" access="remote" returntype="string" returnformat="JSON">
    <cfargument name="summonerName" required="true" type="string">
    <cfargument name="region" required="true" type="string">

    <cfset requesturl = "https://" & lCase(region) & "1.api.riotgames.com/lol/summoner/v4/summoners/by-name/" & summonerName & "?api_key=" & api_key>

    <cfhttp 
        method="get"
        url="#requesturl#" result="SummonerDTOJson">
        <cfhttpparam name="content-type" value="application/json" type="header">
        <cfhttpparam name="accept" value="application/json" type="header">
    </cfhttp>

    <cfset summonerDTO=deserializeJSON(SummonerDTOJson.filecontent)>
    <cfset client.profileIcon
    ="https://raw.communitydragon.org/pbe/plugins/rcp-be-lol-game-data/global/default/v1/profile-icons/" & summonerDTO.profileIconId & ".jpg">
    <cfreturn serializeJSON(summonerDTO)>
</cffunction>

虽然图像url存在,但我无法设置图像的源。
我真的需要帮助,谢谢您的帮助。

变量必须包含在#符号中,以便对其进行求值,即#callererRequests.profileIcon#。。。img标记必须位于cfouput/writeOutput(如果还没有的话)内。这涵盖了您在ColdFusion和VueJS上寻找的很多内容:@SOS
标记是VueJS元素,而不是ColdFusion@ProudyyVueJS如何加载召唤请求?如果这是通过AJAX实现的,您是否查看了AJAX数据以查看是否得到了您想要的?他需要弄清楚这是VueJS问题还是ColdFusion问题。变量必须包含在#符号中,以便对其进行计算,即#callagerRequests.profileIcon#。。。img标记必须位于cfouput/writeOutput(如果还没有的话)内。这涵盖了您在ColdFusion和VueJS上寻找的很多内容:@SOS
标记是VueJS元素,而不是ColdFusion@ProudyyVueJS如何加载召唤请求?如果这是通过AJAX实现的,您是否查看了AJAX数据以查看是否得到了您想要的?他需要弄清楚这是VueJS问题还是ColdFusion问题。