安装
npm install xkeshi/vue-qrcode --save
在需要的页面中引入
import QRcode from '@xkeshi/vue-qrcode';
components: {
qrcode : QRcode
}
在el-table中
<el-table-column label="二维码" width="120">
<template slot-scope="scope">
<qrcode :value="$config.qrURL+'?id='+scope.row.id+'&projectId='+scope.row.projectId" :options="{ size: 100 }"></qrcode>
</template>
</el-table-column>
$config.qrURL+'?id='+scope.row.id+'&projectId='+scope.row.projectId 替换成你的数据 比如 www.baidu.com