Vueless component anatomy
Component Anatomy
1. Script Setup with inheritAttrs Disabled
inheritAttrs DisableddefineOptions({ inheritAttrs: false });2. Props Declaration with Defaults
import { getDefaults } from "../utils/ui.ts";
import defaultConfig from "./config.ts";
import { COMPONENT_NAME } from "./constants.ts";
import type { Props, Config } from "./types.ts";
const props = withDefaults(defineProps<Props>(), {
...getDefaults<Props, Config>(defaultConfig, COMPONENT_NAME),
});3. useUI Composable for Styling and Attributes
Last updated