You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@bikariya/modals

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bikariya/modals

Bikariya modals for Nuxt

latest
Source
npmnpm
Version
0.0.8
Version published
Weekly downloads
53
-5.36%
Maintainers
1
Weekly downloads
 
Created
Source

@bikariya/modals

模态框状态管理,基于 Pinia

安装

pnpm i -D @bikariya/modals

使用方式

  • nuxt.config.ts 中添加模块:

    export default defineNuxtConfig({
      modules: [
        "@bikariya/modals",
      ],
    });
    
  • 在根组件或 Layout 中添加模态框容器:

    <template>
      <bikariya-modals />
    </template>
    
  • components 文件夹下创建模态框组件:

    <script lang="ts" setup>
      import type { ModalEmits, ModalProps } from "#modals";
    
      defineProps<ModalProps>();
      defineEmits<ModalEmits>();
    </script>
    
    <template>
      <transition>
        <div v-if="open">
          <span>I'm a modal.</span>
          <button @click="$emit(`close`)">Close</button>
        </div>
      </transition>
    </template>
    
  • 在页面或组件中使用模态框:

    <script lang="ts" setup>
      import { LazySimpleModal } from "#components";
    
      const modalStore = useModalStore();
      const { open, close } = modalStore.use(() => h(LazySimpleModal));
    </script>
    

FAQs

Package last updated on 25 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts