Last active
August 2, 2019 10:06
-
-
Save tokchin/0ca1110498d8ce3fd47a59f9b7356734 to your computer and use it in GitHub Desktop.
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 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