嘿,我正在尝试使用此资源中的pokeAPI https://pokeapi.co/docsv2/
let Pokedex = require('pokedex-promise-v2');
let Poke = new Pokedex();
但随后使用它而不是能够使用Poke.WhateverFunctionHonestly
我需要使用Poke["pokedex-promise-v2"].WhateverFunctionHonestly
为什么会这样,我怎么能像Poke.WhateverFunctionHonestly
一样使用它
使用可以这样尝试
let Pokedex = require('pokedex-promise-v2');
let Poke = {};
Poke["pokedex-promise-v2"] = new Pokedex()
Poke["pokedex-promise-v2"].getPokemonByName('eevee') // with Promise
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log('There was an ERROR: ', error);
});