vue2.0 audio/img binding src is invalid (unknown) solution

If neither :src='value' nor v-bind:src = 'value' work, try this:

This is the content of the dom

<audio ref="audio" src="" controls="controls">
</audio>

Assign a value to the node whose ref is audio in the event

audioUrl = row.url.replace(/\\/g, '/') /* 替换后台返回的\  */
audioUrl = baseUrl + '/' + audioUrl /*拼接成可访问的链接*/
this.$refs.audio.src = audioUrl  /*嗯,那些都不重要,最主要是这句*/

Pro test feasible

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325647411&siteId=291194637