Element-UI效果不显示

img

img

img


这个使用了EL-UI实现的一个超链接
但是这个程序运行时有时候不能点击,那个字体显示垂直居中的时候可以点击

求求解!

在a标签中加个href.

a标签改为span

【相关推荐】



  • 帮你找了个相似的问题, 你可以看下: https://ask.csdn.net/questions/7795974
  • 这篇博客也不错, 你可以看下关于Element-UI的穿梭框数据量大时,点击‘全选’卡顿问题解决
  • 除此之外, 这篇博客: Element UI 表格数据格式化中的 有插槽时的数据格式化 部分也许能够解决你的问题, 你可以仔细阅读以下内容或跳转源博客中阅读:

    但若使用了插槽,该如何对数据进行格式化呢?可以参考下方完整范例:

    <template>
        <div style="padding: 20px">
            <el-table
                    :data="tableData"
                    style="width: 100%"
                    border
            >
                <el-table-column
                        v-for="(item,index) in config.itemList"
                        :key="index"
                        :prop="item.prop"
                        :label="item.label"
                        align="center"
                >
                    <template slot-scope="scope">
                        <span v-if="item.formatter">
                            {{ item.formatter(scope.row[item.prop])}}
                        </span>
                        <span v-else>
                            {{ scope.row[item.prop]}}
                        </span>
                    </template>
                </el-table-column>
            </el-table>
        </div>
    </template>
    <script>
        export default {
            data() {
                return {
                    tableData: [
                        {
                            name: "张三",
                            gender: "1"
                        },
                        {
                            name: "李丽",
                            gender: "2"
                        },
                        {
                            name: "何华",
                            gender: ""
                        },
                    ],
                    config: {
                        itemList: [
                            {
                                label: '姓名',
                                prop: 'name'
                            },
                            {
                                label: '性别',
                                prop: 'gender',
                                formatter: (val) => {
                                    if (val === '1') {
                                        return '男'
                                    } else if (val === '2') {
                                        return '女'
                                    } else {
                                        return '未知'
                                    }
                                }
                            },
                        ]
                    },
                }
            },
        }
    </script>
    <style scoped>
    </style>


如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^