久久r热视频,国产午夜精品一区二区三区视频,亚洲精品自拍偷拍,欧美日韩精品二区

您的位置:首頁技術(shù)文章
文章詳情頁

javascript - vue element-ui 上傳文件組件怎么使用

瀏覽:153日期:2023-06-08 09:24:13

問題描述

請(qǐng)問element-ui的上傳組件怎么使用,最好有demo可以看一下,官網(wǎng)的實(shí)在沒看懂!謝謝了

問題解答

回答1:

<el-upload action='//jsonplaceholder.typicode.com/posts/' :on-preview='handlePreview' :on-remove='handleRemove' :file-list='fileList'> <el-button size='small' type='primary'>點(diǎn)擊上傳</el-button> <p slot='tip' class='el-upload__tip'>只能上傳jpg/png文件,且不超過500kb</p></el-upload><script> export default { data() { return {fileList: [{name: ’food.jpeg’, url: ’https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100’}, {name: ’food2.jpeg’, url: ’https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100’}] }; }, methods: { handleRemove(file, fileList) {console.log(file, fileList); }, handlePreview(file) {console.log(file); } } }</script>

官網(wǎng)的代碼直接用,然后在后臺(tái)接口去接受處理文件不久ok了嗎

標(biāo)簽: JavaScript
相關(guān)文章:
主站蜘蛛池模板: 敦化市| 溆浦县| 永顺县| 九寨沟县| 汉沽区| 图们市| 井冈山市| 凤凰县| 封开县| 阜新市| 临湘市| 花垣县| 扎赉特旗| 承德县| 沁阳市| 珲春市| 大竹县| 凌海市| 平乐县| 兴义市| 九龙城区| 罗江县| 绿春县| 西城区| 香港 | 铜川市| 恩平市| 葵青区| 东乡族自治县| 巨野县| 南昌县| 德州市| 江西省| 保靖县| 安吉县| 天津市| 丹巴县| 涟水县| 高密市| 同德县| 利津县|