Dark mode
Application APIs
API หลักสำหรับสร้างและจัดการ Vue Application Instance
API | Description |
---|---|
createApp() | สร้าง instance ของแอปพลิเคชัน Vue |
createSSRApp() | สร้างแอปพลิเคชันในโหมด Server-Side Rendering |
app.mount() | Mount แอปพลิเคชันเข้ากับ DOM |
app.unmount() | Unmount แอปพลิเคชันจาก DOM |
app.onUnmount() | เรียกฟังก์ชันเมื่อแอปพลิเคชันถูก unmount |
app.component() | ลงทะเบียนหรือเรียกดู component |
app.directive() | ลงทะเบียนหรือเรียกดู directive |
app.use() | ติดตั้ง plugin |
app.mixin() | ลงทะเบียน mixin |
app.provide() | ระบุค่าที่จะถูก inject ในแอปพลิเคชัน |
app.runWithContext() | เรียกฟังก์ชันใน context ของแอปพลิเคชัน |
app.version | เวอร์ชันปัจจุบันของแอปพลิเคชัน |
app.config | คอนฟิกของแอปพลิเคชัน |
Config APIs
การกำหนดค่าต่างๆ ของแอปพลิเคชัน
API | Description |
---|---|
app.config.errorHandler | กำหนด global error handler |
app.config.warnHandler | กำหนด global warn handler |
app.config.performance | คอนฟิก performance ของแอปพลิเคชัน |
app.config.compilerOptions | คอนฟิก compiler ของแอปพลิเคชัน |
app.config.globalProperties | กำหนด global properties ที่สามารถเข้าถึงได้ในทุก component |
app.config.optionMergeStrategies | กำหนด strategies สำหรับการ merge options |
app.config.idPrefix | กำหนด prefix สำหรับ id ของแอปพลิเคชัน |
app.config.throwUnhandledErrorInProduction | กำหนดการ throw error ใน production |
General APIs
API ทั่วไปที่ใช้ทั้งใน Composition และ Options API
API | Description |
---|---|
version | เวอร์ชันปัจจุบันของ Vue |
nextTick() | รอจนกว่า DOM จะอัพเดท |
defineComponent() | กำหนด TypeScript type สำหรับ component |
defineAsyncComponent() | สร้าง async component |
Global APIs
API ระดับ global ที่สามารถเรียกใช้ได้ทุกที่
API | Description | Category |
---|---|---|
createApp() | สร้าง Vue application instance | Application |
h() | สร้าง virtual node | Render |
defineComponent() | กำหนด TypeScript type สำหรับ component | TypeScript |
defineAsyncComponent() | กำหนด async component | Component |
resolveComponent() | แก้ชื่อ component เป็น constructor | Render |
nextTick() | รอ DOM update เสร็จ | DOM |