App Vue 元件是主要應用程式元件,可用於定義全域主題(iOS 或 Material)和其他有用的全域設定。
如果您將 Konsta UI 與其他框架(如 Framework7 或 Ionic)一起使用,則應改用 KonstaProvider。
包含以下元件
App
名稱 | 類型 | 預設值 | 描述 |
---|---|---|---|
component | 字串 | 'div' | 元件的 HTML 元素 |
dark | 布林值 | false | 包含 |
safeAreas | 布林值 | true | 將 |
theme | 'ios' | 'material' | 'parent' | 'material' | 應用程式主題。如果設定為 |
touchRipple | 布林值 | true | 在 Material 主題中啟用觸摸漣漪效果。允許全域停用所有元件的觸摸漣漪 |
App
元件應作為所有 Konsta UI 元件的主要包裝器使用,並且在應用程式中一次只能有一個 App
元件
<template>
<!-- App component ideally should be the main root component -->
<k-app theme="ios" safe-areas>
<!-- rest of Konsta UI components -->
</k-app>
</template>
<script>
import { kApp } from 'konsta/vue';
export default {
components: {
kApp,
},
};
</script>