Skip to content

Instantly share code, notes, and snippets.

@blueplanet
Last active June 19, 2018 00:52
Show Gist options
  • Save blueplanet/76d6caf7c54de6a3d632817c54cbf03d to your computer and use it in GitHub Desktop.
Save blueplanet/76d6caf7c54de6a3d632817c54cbf03d to your computer and use it in GitHub Desktop.
iView の Table コンポネントで画像を render する方法 ref: https://qiita.com/blueplanet/items/748d255507cbe79246d1
<template>
<div>
<Table :columns="columns" :data="tokens"></Table>
</div>
</template>
<script>
export default {
data () {
return {
columns: [
{
title: 'Name',
key: 'name',
render: (h, params) => {
return h('div', [
h('img', { attrs: { src: require(`../../images/${params.row.icon}`) } }),
])
}
},
]
};
},
};
</script>
<template>
<div>
<Table :columns="columns" :data="tokens"></Table>
</div>
</template>
<script>
export default {
data () {
return {
columns: [
{
title: 'Name',
key: 'name',
render: (h, params) => {
return h('div', [
h('img', { attrs: { src: require(`../../images/${params.row.icon}`) } }),
])
}
},
]
};
},
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment