Last active
June 19, 2018 00:52
-
-
Save blueplanet/76d6caf7c54de6a3d632817c54cbf03d to your computer and use it in GitHub Desktop.
iView の Table コンポネントで画像を render する方法 ref: https://qiita.com/blueplanet/items/748d255507cbe79246d1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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