使用ESlint警告:Require self-closing on Vue.js custom components (<el-table-column>)报错解决

解决方式:配置eslintrc.js;添加配置内容如下:

"vue/html-self-closing": ["error", {
            "html": {
                "void": "never",
                "normal": "any",
                "component": "any"
            },
            "svg": "always",
            "math": "always"
        }],

引用自

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
<template> <el-table :data="tableData" style="width: 100%" stripe ref="multipleTable" @selection-change="handleSelectionChange" :header-cell-style="{background:'#eef1f6',color:'#606266'}"> <el-table-column prop="id" label="编号" sortable /> <el-table-column prop="img" label="图片url" sortable /> <el-table-column prop="img" label="缩略图"> <template v-slot="products"> <img :src="products.row.img" min-width="70" height="70"/> </template> </el-table-column> <el-table-column prop="image" label="图片" min-width="20%" > <!-- 图片的显示 --> <template #default="scope"> <!--<img :src="scope.row.img" min-width="70" height="70" />--> </template> </el-table-column> <el-table-column align="center" label="图片url"> <template v-slot="products"> <!--<img :src="require('../file/img/' + item)" v-for="item in list" :key="item" alt="">--> <el-image style="width: 100px; height: 100px" :src="products.row.img" ></el-image> <!--<img :src="require(''+products.row.img)" style=" width:100px; height:100px" />--> </template> </el-table-column> </el-table> </template> <script setup> import {ref,toRefs,reactive,onMounted,getCurrentInstance} from 'vue' let { proxy } = getCurrentInstance(); import router from '@/router' onMounted(()=>{ getTableData(); }); //获取表单信息 let tableData = ref([]); function getTableData() { proxy.$http.get('/ImgController/imgFind') .then(res => { tableData.value=res.data; console.log(res.data) }) .catch(err => { console.log(err) }); } </script> <style scoped> </style>修改以上代码,是他能够显示图片
05-25

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值