Skip to content

Instantly share code, notes, and snippets.

View shunnNet's full-sized avatar

shunnNet shunnNet

  • Taiwan
  • 07:26 (UTC +08:00)
View GitHub Profile
@shunnNet
shunnNet / browser-ai-vai-plugin-question.md
Last active January 1, 2024 23:19
How to scrap all `.vue` template info at build time ?

前言

我有一個專案叫 browser-ai,在裡面有個功能是可以使用 Vue 的 directive 為 DOM 綁上標籤

<template>
  <h1 v-ai="{ id: 'title', description: 'Search Product In this page' }">...</h1>
</template>

<!-- 上述內容會轉換成 -->
<h1 data-ai-id="title" data-ai-description="Search Product In this page">...</h1>
@shunnNet
shunnNet / useMemorized-reproduce.js
Created September 29, 2023 04:18
useMemorized can't be destructed
import { useFetch, useMemoize } from '@vueuse/core'
const getTodo = useMemoize(() => useFetch('https://jsonplaceholder.typicode.com/todos/1').get().json())
const { data } = getTodo()
// get null
console.log(data)
setTimeout(() => {