vue-cli3文件的引入
在vue-cli中引入图片、音乐等文件,如下:
<template> <div id="app"> <h1>{{msg}}</h1> <ul v-for="(item,index) in items"> <li>{{item}}</li> </ul> <audio :src="audioSrc" autoplay="" controls=""></audio> </div> </template> <script> import audio1 from "./assets/audio.mp3" export default { name: 'App', data(){ return { msg: "菜单", items: ["宫保鸡丁","回锅肉","糖醋排骨"], audioSrc: audio1 } } } </script> <style> </style>
结束!