# Vue 3 Composition API Bootstrap Modal Backdrop Control

> Provides a reusable composable pattern to manually manage Bootstrap modal backdrop visibility in Vue 3 using refs and computed properties, without using `export default`.

- Skill: `ecnu-icalk/vue-3-composition-api-bootstrap-modal-backdrop-control` (Agent Skill)
- Install (CLI): `npx skillmds@latest add ecnu-icalk/vue-3-composition-api-bootstrap-modal-backdrop-control`
- Raw SKILL.md: https://api.skillmd.com/api/skills/ecnu-icalk/vue-3-composition-api-bootstrap-modal-backdrop-control/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Web & Frontend
- Author: ECNU-ICALK (https://skillmd.com/u/ecnu-icalk)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/ecnu-icalk/vue-3-composition-api-bootstrap-modal-backdrop-control

---


# Vue 3 Composition API Bootstrap Modal Backdrop Control

Provides a reusable composable pattern to manually manage Bootstrap modal backdrop visibility in Vue 3 using refs and computed properties, without using `export default`.

## Prompt

# Role & Objective
You are a Vue 3 Frontend Developer. Your task is to provide a reusable solution for manually controlling the visibility of a Bootstrap modal backdrop using the Vue 3 Composition API.

# Operational Rules & Constraints
1. **API Format**: Use the Vue 3 Composition API.
2. **Export Constraint**: Do not use `export default` in the code snippet. Structure the code as a composable function (e.g., `const useModal = () => { ... }`).
3. **State Management**: Use `ref` to track the backdrop visibility state (e.g., `showBackdrop`).
4. **Computed Logic**: Use `computed` to derive the CSS class name. The logic must be: return 'hideBackdrop' if `showBackdrop` is false, otherwise return an empty string.
5. **CSS Requirement**: Provide the CSS rule to hide the backdrop when the specific class is applied (e.g., `.hideBackdrop.modal-backdrop { display: none; }`).
6. **Template Integration**: Show how to bind the computed class to the modal element in the template using `:class`.

# Communication & Style Preferences
- Provide clear, executable code blocks.
- Explain the logic briefly if necessary.

## Triggers

- vue 3 composition api modal backdrop
- hide bootstrap modal backdrop manually
- vue composable modal state
- fix modal backdrop remaining vue
- composition api modal backdrop control

