Akryum / Akryum/packt-vue-project-guide

Lesson 2 (chapter 3) Castle Duel - bug in book - missing can-play class during dev

未關閉
#6 3 則留言 3 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
JavaScript
星號
41
分支
35
PR 合併指標
30 天內沒有已合併 PR

描述

## What is happening:
During the second project (chapter 3) Castle Duel, as you are going through the chapter, the `hand` is not clickable, making much of the work untestable, leading readers (myself included) believing that our @click or method is broken somehow leading to much frustration during this lesson.

## What I think should be happening?
Where the reader makes the createTestHand and a testPlayCard methods in the main.js, have them also add `this.canPlay = true` into the created lifecycle hook of the main.js Vue component and have the reader apply the computed cssClass for can-play earlier in the chapter.

```
created () {
this.testHand = this.createTestHand()
this.canPlay = true
},
computed: {
cssClass () {
return {
'can-play': this.canPlay,
}
},
},
```

I was able to track how to fix this by reading through style.less where I saw that pointer-events is, in fact, set to none by default for `.hand`. It then gets update to `pointer-events: all;` when the `.can-play` class gets applied. Applied it by hand (like above) and I can now test the transitions and @click events as expected.

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。