Skip to content

Instantly share code, notes, and snippets.

@tokchin
Last active August 2, 2019 10:06
Show Gist options
  • Save tokchin/0ca1110498d8ce3fd47a59f9b7356734 to your computer and use it in GitHub Desktop.
Save tokchin/0ca1110498d8ce3fd47a59f9b7356734 to your computer and use it in GitHub Desktop.
<template>
<div id="app">
//インポートしたitem-gridコンポーネントにthis.itemsを渡して、
//index1-10までのアセットを表示
<app-item-grid :items="items"></app-item-grid>
</div>
</template>
<script>
import ItemGrid from './ItemGrid.vue'
//web3_util.jsを呼び出してgetRandomAssetsの関数をインポート
import {getRandomAssets} from '../js/web3_util.js'
export default {
name: 'app',
data: function () {
return {
items: []
}
},
mounted: async function(){
//this.itemsにgetRandomAssetsで入手したデータを保存
this.items = await getRandomAssets().then(function(value){
return value
})
},
components: {
appItemGrid: ItemGrid
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment