Dark mode
Web Components
API สำหรับการทำงานกับ Web Components ช่วยให้ Vue Component สามารถทำงานร่วมกับ Custom Elements ได้อย่างสมบูรณ์ และใช้งานฟีเจอร์ต่างๆ ของ Web Components เช่น Shadow DOM
API | คำอธิบาย | Category |
---|---|---|
defineCustomElement() | สร้าง custom element จาก Vue component | Web Components |
useHost() | เข้าถึง host element ใน Composition API | Web Components |
useShadowRoot() | ใช้งาน Shadow DOM | Web Components |
this.$host | เข้าถึง host element ใน Options API | Web Components |
Render Function
API สำหรับการสร้างและจัดการ Virtual Nodes (VNodes) โดยตรง แทนการใช้ Template ซึ่งให้ความยืดหยุ่นสูงในการควบคุมการเรนเดอร์
API | คำอธิบาย | Category |
---|---|---|
h() | สร้าง virtual nodes | Render Core |
mergeProps() | รวม multiple props objects | Render Utility |
cloneVNode() | คัดลอก VNode | Render Utility |
isVNode() | ตรวจสอบว่าเป็น VNode หรือไม่ | Render Utility |
resolveComponent() | แก้ชื่อ component เป็น constructor | Render Utility |
resolveDirective() | แก้ชื่อ directive เป็น constructor | Render Utility |
withDirectives() | สร้าง VNode พร้อม directives | Render Utility |
withModifiers() | สร้าง VNode พร้อม modifiers | Render Utility |
Server-Side Rendering
API สำหรับการทำงานกับ Server-Side Rendering (SSR) ช่วยให้สามารถเรนเดอร์แอปเป็นบนเซิร์ฟเวอร์ก่อนส่งไปยังไคลเอนต์
API | Description | Category |
---|---|---|
renderToString() | เรนเดอร์แอปเป็นสตริง HTML | SSR Core |
renderToNodeStream() | เรนเดอร์แอปเป็น Node.js Readable stream | SSR Core |
useSSRContext() | เข้าถึง SSR context ใน setup() | SSR Utilities |
onServerPrefetch() | ดึงข้อมูลก่อนเรนเดอร์บนเซิร์ฟเวอร์ | SSR Lifecycle |
TypeScript Utility Types
Type Helpers สำหรับการทำงานกับ TypeScript ใน Vue ช่วยให้สามารถกำหนดประเภทข้อมูลต่างๆ ได้อย่างแม่นยำ
Type | Description | Category |
---|---|---|
PropType<T> | กำหนด type สำหรับ props | Props |
MaybeRef<T> | Type สำหรับ ref หรือไม่ใช่ ref | Reactivity |
MaybeRefOrGetter<T> | Type สำหรับ ref หรือ getter | Reactivity |
ExtractPropTypes<T> | Type สำหรับ props ของ component | Props |
ExtractPublicPropTypes<T> | Type สำหรับ public props ของ component | Props |
ComponentCustomProperties | เพิ่ม custom properties | Component |
ComponentCustomOptions | Type สำหรับ custom options ของ component | Component |
ComponentCustomProps | Type สำหรับ custom props ของ component | Component |
CSSProperties | Type สำหรับ CSS properties | Style |
Custom Renderer
API สำหรับสร้าง custom renderer เพื่อใช้งาน Vue กับ platform อื่นๆ นอกเหนือจาก DOM
API | Description | Category |
---|---|---|
createRenderer() | สร้าง custom renderer | Renderer Core |
createHydrationRenderer() | สร้าง renderer พร้อม hydration | SSR Renderer |
nodeOps | ตัวเลือกการทำงานกับโหนด | Renderer Config |
patchProp | ตัวเลือกการอัปเดต props | Renderer Config |
Compile-Time Flags
Flags สำหรับปรับแต่งการทำงานของ compiler ในช่วง build time
Flag | Description | Category |
---|---|---|
__VUE_OPTIONS_API__ | เปิด/ปิด Options API | Compatibility |
__VUE_PROD_DEVTOOLS__ | เปิด/ปิด DevTools ใน production | Debugging |
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ | แสดงรายละเอียด hydration mismatch | Debugging |