English | 中文
My solutions and explanations for Vuejs-Chanllenges from vuejs-challenges .
This repo includes explanations and correct answers for the chanllenges, give you a better experience to finish the questions.
-
Clone the projects and run
pnpm install
git clone git@github.com:Hacker-C/vuejs-challenges.git cd vuejs-challenges pnpm install
-
For every question, such as
1-hello-world
,copyApp.vue
andindex.test.ts
from here,then paste to the local folderquestions
.
There are to ways to test your answers.
-
(Recommend) When you want to test just one case, such as the
243-prevent-event-propagation
,you can runpnpm test 243
to only test it.pnpm test 243 ✓ questions/243-prevent-event-propagation/index.test.ts (1) Test Files 1 passed (1) Tests 1 passed (1) Time 4.62s (in thread 75ms, 6161.66%) PASS Waiting for file changes... press h to show help, press q to quit
-
Run the script
pnpm test
,then you can see if your answer passes the test.pnpm test ✓ questions/1-hello-word/index.test.ts (1) ✓ questions/2-ref-family/index.test.ts (2) Test Files 2 passed (2) Tests 3 passed (3) Time 4.42s (in thread 141ms, 3134.95%) PASS Waiting for file changes... press h to show help, press q to quit
-
Run
pnpm test:ui
,and click the link to see if you answers get passed with visualization.
Also, you can run pnpm dev
to see if the page works properly.(Remember to change the path of the App in main.ts)
That's all, have fun!