| difficulty | tags |
|---|---|
3 |
pinia, state |
Lorem Ipsum?
Alpha
| --- | |
| globs: **/*.vue,**/*.ts,**/*.js | |
| alwaysApply: false | |
| --- | |
| # Vue 3 Best Practices & Rules | |
| ## General Rules | |
| ALWAYS use the Composition API with `<script setup>` syntax. |
| /** @type {import('eslint').Rule.RuleModule} */ | |
| export default { | |
| meta: { | |
| type: "suggestion", | |
| docs: { | |
| description: "Enforce proper Nuxt data fetching patterns", | |
| category: "Best Practices", | |
| recommended: true, | |
| }, | |
| hasSuggestions: true, |
| [ | |
| { | |
| title: 'The Vue.js Master Class 2024 Edition', | |
| courseUrl: 'https://vueschool.io/courses/the-vuejs-3-master-class', | |
| isPremium: true, | |
| isComingSoon: false, | |
| duration: '11 hrs', | |
| lessonCount: '127 lessons', | |
| skillLevel: 'Intermediate', | |
| description: 'Unlock your full potential with the Vue.js Master Class 2024 Edition! Build real-world apps using Supabase, advanced state management, dynamic...', |
| // server/api/upload/post.ts | |
| // Endpoint to upload the files | |
| import { H3Error } from "h3"; | |
| export default defineEventHandler(async (event) => { | |
| // Parse multipart form data | |
| const formData = await readMultipartFormData(event); | |
| if (!formData || formData.length === 0) { |
| You are an expert full-stack Nuxt developer working on a Nuxt 3 project. | |
| ## High Level Project Spec | |
| This section gives a high-level overview of the app we're creating in this project. | |
| - It's a test creator that takes in screenshots of pages from a text book and outputs an interactive exam. | |
| - The primary audience of this application is home school teachers who need to create tests for their students | |
| - Users expect a friendly but professional look and feel |
| const pw = require('playwright'); | |
| const AUTH = '...'; | |
| const SBR_CDP = `wss://${AUTH}@brd.superproxy.io:9222`; | |
| async function main() { | |
| console.log('Connecting to Scraping Browser...'); | |
| const browser = await pw.chromium.connectOverCDP(SBR_CDP); | |
| try { | |
| console.log('Connected! Navigating...'); | |
| const page = await browser.newPage(); | |
| await page.goto('https://amazon.com',{ timeout: 2 * 60 * 1000 }); |
| // server/api/currentDate | |
| import { stringify } from "devalue" | |
| export default defineEventHandler(async (event) => { | |
| const data = { | |
| createAt: new Date(), | |
| } | |
| if (getHeader(event, 'Content-Type') === 'application/devalue') { | |
| const dataToJSON = { |
| import { ref, watch, readonly } from 'vue'; | |
| export const useRefDebounced = (aRef, ms) => { | |
| const debouncedRef = ref(aRef.value); | |
| // use the debounce function defined below to return a debounced ref whose value only syncs with `aRef` after `ms` milliseconds | |
| const debouncedUpdate = debounce(() => { | |
| debouncedRef.value = aRef.value; | |
| }, ms); | |
| watch(aRef, debouncedUpdate); |
| WEBVTT | |
| 00:00:04.553 --> 00:00:08.567 | |
| Congratulations on completing our course | |
| in test-driven development | |
| 00:00:08.600 --> 00:00:10.600 | |
| with Vue and TypeScript. | |
| 00:00:11.000 --> 00:00:13.267 |