vue 已经定义了方法 却一直提示未定义是什么鬼啊

methods: {
handlePlay(){
console.log('card')
},
createTestHand(){
const cards = [];
const ids = Object.keys(cards);
for(let i=0;i<5;i++){
cards.push(testDrawCard());
}
console.log(cards);
return cards
},
testDrawCard(){
const ids = Object.keys(cards);
const randomId = ids[Math.floor(Math.random()*ids.length)];
return {
uid: cardUid++,
id: randomId,
def: cards[randomId],
}
},
},

created(){
this.testHand = this.createTestHand();
},

查看全部
weixin_39946839
猪头,怪我喽
2019/06/14 18:38
  • vue.js
  • 点赞
  • 收藏
  • 回答
    私信

1个回复