Letters on the Move — Vue

Move the kelurahan’s letters app from Vue 2 to Vue 3 a piece at a time while the counter serves. 14 levels, played right in the browser with nothing to install.

What the levels ask

  1. The old PC at the Pandean Village Office counter runs Layanan Surat Pandean on Vue 2. The new laptop from Diskominfo only has Vue 3, and Vue 3 has no Vue to build with new. This morning Ms. Puput calls three villagers on both machines, and the laptop’s screen must match the old PC’s exactly. Fill in the two lines of main.js for the laptop.
  2. The applicant’s name on the letter preview must be all capitals. On the old PC, main.js registers a kapital filter, and filters no longer exist in Vue 3. Today Mr. Dodi and Mr. Rohim are served on the old PC first, then on the laptop, with the same App.vue. Fill in the name line of the preview so both machines write it in capitals.
  3. Today the whole app moves to the laptop, though its code is not ready for Vue 3: the KKN team’s components still use v-model the Vue 2 way, and main.js still registers a directive through Vue.directive. Vue has a migration build, @vue/compat, that runs Vue 2 code on top of Vue 3 while warning about everything that has to move. Three villagers come, and every letter must be right; migration warnings are allowed today. Fill in the alias in vite.config.js and the mounting line in main.js.
  4. The Name and NIK fields on the counter screen are InputWarga.vue, a component the KKN team wrote. Today it moves to Vue 3’s v-model: the compatConfig option inside it has already switched the Vue 2 way off. Villagers type their NIK exactly as the ID card prints it, a space every four digits, and isiNik in App.vue drops the spaces. Fill in the three holes: the prop’s name and the event’s name in InputWarga.vue, and how the NIK field in App.vue uses the component.
  5. Today main.js switches off two Vue 2 behaviours in the migration build: a class attribute and listeners given to a component now fall through to its root element, as in Vue 3. TombolCetak.vue emits click from its button, and App.vue listens for it with @click="cetak" while giving it class="utama". Mr. Harun and Mrs. Yanti come. Fill in the hole in TombolCetak.vue’s options, so one press prints one letter and the button stays orange.
  6. A printed letter goes to the Village Head’s desk with the Kirim button. TombolKirim.vue wraps that button in a div, and App.vue gives it class="kirim utama" and @click="kirim". The KKN team passed both on to the button the Vue 2 way, though the Vue 2 behaviour for listeners was switched off yesterday. Mr. Dodi and Mr. Rizal come. Fill in the two holes in TombolKirim.vue, so one press sends one letter and the button is orange.
  7. The counter’s shelf holds four letters from yesterday, and Mr. Wiryo’s has already been picked up. ArsipSurat.vue shows a row for every letter still waiting, and the Diambil button marks it. In Vue 2, v-if and v-for on the same element meant loop first, then filter; in Vue 3 the order is the other way round. Mrs. Ratna and Ms. Sri come for their letters. Fill in the two holes in the <li>.
  8. The print page is rewritten straight for Vue 3, with no migration build. The date on the paper is written by v-tanggal, the KKN team’s directive in tanggal.js. The Village Head can only sign tomorrow, then there is a meeting at the district, so Ms. Puput moves the date on Mr. Dodi’s letter twice, and the date on the paper must follow. Directive hook names changed in Vue 3. Fill in the two hook names.
  9. The calling board in the waiting room shows the number being called, and this board is Vue 3 alone too. Every new number must slide down from above as it appears, because Mr. Sugeng is often half asleep on the bench. <transition name="geser"> and its active classes are already there. Fill in the selectors for the state of a number about to come in and a number done leaving.
  10. The letterhead on the preview comes from kopSurat.js, a KKN team mixin that adds a lembar object to the component’s data. PratinjauSurat.vue has a lembar of its own for the number of copies. From today main.js switches off Vue 2 style merging of mixin data, and Ms. Puput has already written useKop.js to replace it. Mr. Wiryo and Mrs. Ida come. Fill in the two holes: how the component gets the letterhead, and how the template writes its name.
  11. Two KKN team mixins, the form and the queue, both have a reset method. One empties the form, the other starts the queue again at number 1, and yesterday the Batal button called the wrong one. Today App.vue uses useFormulir and useAntrean. The Batal button calls batal, and setup returns nama, nik, isiNik, nomor, maju and batal. Mrs. Ida is back, and Ms. Puput mistypes again. Fill in the two lines in setup.
  12. The queue moves to Pinia: store/antrean.js now holds useAntreanStore, while the letters stay in Vuex until next week. In App.vue, setup must give a nomor that changes every time maju is called, and main.js must install both stores. Ms. Wulan and Mr. Sugeng come. Fill in the two holes.

And more, 14 levels in all.