1.0.5 • Published 1 year ago

cube-vue3-modal v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Cube Vue3 Modal

Usage

With v-model:

<template>
  <div>
    <button @click="modal = true">Open</button>
    <Modal v-model="modal">
      <!-- The modal content here -->
    </Modal>
  </div>
</template>

<script setup lang="ts">
const modal = ref(false)
</script>

From ref:

<template>
  <div>
    <button @click="openModal">Open</button>
    <Modal ref="modal">
      <!-- The modal content here -->
    </Modal>
  </div>
</template>

<script setup lang="ts">
import Modal from 'cube-vue3-modal'
const modal = ref<InstanceType<typeof Modal>>()

async function openModal() {
  if (modal.value) {
    await modal.value.open()
    alert('The modal is now opened')
  }
}
</script>

Vue 3 + TypeScript + Vite

This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 <script setup> SFCs, check out the script setup docs to learn more.

Recommended IDE Setup

Type Support For .vue Imports in TS

TypeScript cannot handle type information for .vue imports by default, so we replace the tsc CLI with vue-tsc for type checking. In editors, we need TypeScript Vue Plugin (Volar) to make the TypeScript language service aware of .vue types.

If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a Take Over Mode that is more performant. You can enable it by the following steps:

  1. Disable the built-in TypeScript Extension
    1. Run Extensions: Show Built-in Extensions from VSCode's command palette
    2. Find TypeScript and JavaScript Language Features, right click and select Disable (Workspace)
  2. Reload the VSCode window by running Developer: Reload Window from the command palette.

Environment variables

Create a .env file with the following variables:

VITE_PORT=8080
1.0.5

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.0-beta.6

1 year ago

1.0.0-beta.5

1 year ago

1.0.0-beta.4

1 year ago

1.0.0-beta.3

1 year ago

1.0.0-beta.2

1 year ago

1.0.0-beta.1

1 year ago