-
-
-
-
+
-
Cari kata berikut:
-
- {{ word }}
+
+ {{ w }}
-
- Temukan semua kata positif seperti sabar, cinta, syukur, dan gembira untuk hati yang ceria!
-
+
Temukan semua kata positif untuk hati yang ceria!
-
-
-
diff --git a/src/router/index.js b/src/router/index.js
index f6521a6..4d399c1 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -17,6 +17,7 @@ import MinigamePage from '@/pages/Minigame.vue'
import FlipcardPage from '@/pages/Flipcard.vue'
import WordspellsPage from '@/pages/Wordspells.vue'
import PointhistoryPage from '@/pages/Pointhistory.vue'
+import itemPage from '@/components/itemPage.vue'
const routes = [
{ path: '/', name: 'home', component: HomePage , meta:{requiresAuth:true}},
@@ -43,6 +44,7 @@ const routes = [
{ path: '/entertainment/mini-games/', name:'mini-games', component:MinigamePage, props:true},
{ path: '/entertainment/mini-games/flipcard/', name:'flipcard', component:FlipcardPage, props:true},
{ path: '/entertainment/mini-games/word-spells/', name:'word-spells', component:WordspellsPage, props:true},
+ { path: '/items/', name:'items', component:itemPage, props:true},
]
const router = createRouter({
diff --git a/src/stores/index.js b/src/stores/index.js
new file mode 100644
index 0000000..a4afde6
--- /dev/null
+++ b/src/stores/index.js
@@ -0,0 +1,8 @@
+import { createStore } from "vuex";
+import items from "./items";
+
+export default createStore({
+ modules: {
+ items
+ }
+});
diff --git a/src/stores/items.js b/src/stores/items.js
new file mode 100644
index 0000000..777921a
--- /dev/null
+++ b/src/stores/items.js
@@ -0,0 +1,35 @@
+export default {
+ namespaced: true,
+
+ // DATA TEMPAT DISIMPAN
+ state: () => ({
+ items: []
+ }),
+
+ // CARA MENGUBAH STATE (HARUS SINKRON)
+ mutations: {
+ SET_ITEMS(state, payload) {
+ state.items = payload;
+ },
+ ADD_ITEM(state, payload) {
+ state.items.push(payload);
+ }
+ },
+
+ // TEMPAT PANGGIL API / FUNGSI ASYNC
+ actions: {
+ fetchItems({ commit }) {
+ // contoh data dari API
+ const data = [
+ { id: 1, name: "Apel" },
+ { id: 2, name: "Mangga" }
+ ];
+
+ commit("SET_ITEMS", data); // <--- mutation dipanggil
+ },
+
+ createItem({ commit }, item) {
+ commit("ADD_ITEM", item);
+ }
+ }
+};