| difficulty | 3 |
|---|---|
| tags | pinia, state |
Lorem Ipsum?
Alpha
| { | |
| "css.validate": false, | |
| "tailwindCSS.emmetCompletions": true, | |
| "workbench.colorTheme": "Material Theme Darker High Contrast", | |
| "git.autofetch": true, | |
| "editor.fontSize": 14, | |
| "editor.fontFamily": "JetBrains Mono", | |
| "editor.fontLigatures": true, | |
| // "eslint.format.enable": true, | |
| // "editor.formatOnSaveMode": "modifications", |
| { | |
| "Pinia Store Boilerplate": { | |
| "prefix": "pinia", | |
| "body": [ | |
| "import { defineStore, acceptHMRUpdate } from \"pinia\";", | |
| "", | |
| "export const use$TM_FILENAME_BASE = defineStore(\"$TM_FILENAME_BASE\", {", | |
| " state: () => {", | |
| " return {", | |
| " $0", |
| { | |
| "Vue defineEmits":{ | |
| "prefix": "defineEmits", | |
| "body" : [ | |
| "defineEmits<{", | |
| " (e: \"${1:event}\", ${2:payload}: { $3 }): void;", | |
| "}>();", | |
| ], | |
| "description": "defineEmits type declaration for Vue.js components" | |
| }, |
| amiralizadeh9480.laravel-extra-intellisense | |
| antfu.iconify | |
| apollographql.vscode-apollo | |
| atlassian.atlascode | |
| be5invis.toml | |
| bierner.markdown-preview-github-styles | |
| bradlc.vscode-tailwindcss | |
| buenon.scratchpads | |
| csstools.postcss | |
| dbaeumer.vscode-eslint |
| dynamic-link-screenshare |
| { | |
| "tables": [ | |
| { | |
| "id": "62757cc0e3b8400009599e54", | |
| "name": "Boards", | |
| "displayName": "boards", | |
| "isSystem": false, | |
| "fields": [ | |
| { | |
| "id": "62757cc0e3b8400009599e5e", |
| <script setup> | |
| import { ref, computed } from "vue"; | |
| import ProductCard from "./components/ProductCard.vue"; | |
| import { useFetch } from "./composables/useFetch"; | |
| // loading products | |
| const { data, loading } = useFetch( | |
| "https://dummyjson.com/products?limit=10000" | |
| ); | |
| const products = computed(() => data.value?.products || []); |
| import { ref } from "vue"; | |
| export const useFetch = (url) => { | |
| const loading = ref(true); | |
| const data = ref(null); | |
| async function fetchData() { | |
| const res = await fetch(url); | |
| const d = await res.json(); | |
| data.value = d; | |
| loading.value = false; |