我有一個專案叫 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>