1. 安装elementUI:npm i element-ui -S
2. 在main.js中引入elementUI
import Element from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(Element, {
size: 'small' })
3. 访问Element官网【组件–Upload上传】
<el-upload
action="https://jsonplaceholder.typicode.com/posts/"
list-type="picture-card"
:on-preview="handlePictureCardPreview"
:on-remove="handleRemove">
<i class="el-icon-plus"><