注意:代码所需vue可以通过npm i vue --save下载,然后引入即可
案例
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="./node_modules/vue/dist/vue.js"></script>
<style>
img {
width: 100px;
height: 100px;
}
</style>
</head>
<body>
<div id="app">
<h3>媒体元素</h3>
<img v-bind:src="img" alt="">
<img v-bind:src="ava" alt=""