@overlastic/vue 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -75
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,84 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://overlastic.vercel.app/" target="blank">
|
|
3
|
+
<img src="https://github.com/hairyf/overlastic/raw/master/docs/public/circle.svg" width="120" alt="Nest Logo" />
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
2
6
|
|
|
3
|
-
>
|
|
7
|
+
<p align="center">
|
|
8
|
+
A create modal | dialog | popup promise deferred library
|
|
9
|
+
</p>
|
|
4
10
|
|
|
5
|
-
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="https://www.npmjs.com/@overlastic/vue"><img src="https://img.shields.io/npm/v/@overlastic/vue.svg" alt="NPM Version" /></a>
|
|
13
|
+
<a href="https://www.npmjs.com/@overlastic/vue"><img src="https://img.shields.io/npm/l/@overlastic/vue.svg" alt="Package License" /></a>
|
|
14
|
+
<a href="https://www.npmjs.com/@overlastic/vue"><img src="https://img.shields.io/npm/dm/@overlastic/vue.svg" alt="NPM Downloads" /></a>
|
|
15
|
+
</p>
|
|
6
16
|
|
|
7
|
-
|
|
8
|
-
```sh
|
|
9
|
-
pnpm add @overlastic/vue
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
With yarn:
|
|
13
|
-
```sh
|
|
14
|
-
yarn add @overlastic/vue
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Global
|
|
18
|
-
|
|
19
|
-
You can register overlays globally, which will inherit the application context for all popups.
|
|
20
|
-
|
|
21
|
-
```ts
|
|
22
|
-
// main.js
|
|
23
|
-
import { createApp } from 'vue'
|
|
24
|
-
import unoverlay from '@overlastic/vue'
|
|
25
|
-
|
|
26
|
-
const app = createApp({})
|
|
27
|
-
app.use(unoverlay)
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## Usage
|
|
17
|
+
## Description
|
|
31
18
|
|
|
32
|
-
|
|
19
|
+
Create messages or dialog overlays using Overlastic in Vue APP.
|
|
33
20
|
|
|
34
|
-
|
|
21
|
+
## Installation
|
|
35
22
|
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
<script setup>
|
|
39
|
-
import { defineEmits, defineProps } from 'vue'
|
|
40
|
-
import { useOverlayDefine } from '@overlastic/vue'
|
|
41
|
-
const props = defineProps({
|
|
42
|
-
title: String,
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
// Get Overlay information from useOverlayDefine
|
|
46
|
-
const { visible, resolve, reject } = useOverlayDefine({
|
|
47
|
-
// Duration of popup layer duration to avoid premature destruction of the component
|
|
48
|
-
duration: 1000,
|
|
49
|
-
})
|
|
50
|
-
</script>
|
|
51
|
-
|
|
52
|
-
<template>
|
|
53
|
-
<div v-if="visible" @click="resolve(`${title}:confirmed`)">
|
|
54
|
-
{{ title }}
|
|
55
|
-
</div>
|
|
56
|
-
</template>
|
|
23
|
+
```bash
|
|
24
|
+
$ npm install --save @overlastic/vue
|
|
57
25
|
```
|
|
58
26
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
You can use the `defineOverlay` method to convert the component into a modal dialog in Javascript / Typescript, which allows you to call it.
|
|
27
|
+
## Quick Start
|
|
62
28
|
|
|
63
|
-
|
|
64
|
-
import { defineOverlay } from '@overlastic/vue'
|
|
65
|
-
import OverlayComponent from './overlay.vue'
|
|
66
|
-
|
|
67
|
-
// Convert to imperative callback
|
|
68
|
-
const callback = defineOverlay(OverlayComponent)
|
|
69
|
-
// Call the component and get the value of the resolve callback
|
|
70
|
-
const value = await callback({ title: 'callbackOverlay' })
|
|
71
|
-
// value === "callbackOverlay:confirmed"
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
You can also use `renderOverlay` to directly call the component and skip the `defineOverlay` method.
|
|
75
|
-
|
|
76
|
-
```ts
|
|
77
|
-
import { renderOverlay } from '@overlastic/vue'
|
|
78
|
-
import OverlayComponent from './overlay.vue'
|
|
79
|
-
|
|
80
|
-
const value = await renderOverlay(OverlayComponent, {
|
|
81
|
-
title: 'useOverlayDefine'
|
|
82
|
-
})
|
|
83
|
-
// value === "useOverlayDefine:confirmed"
|
|
84
|
-
```
|
|
29
|
+
[Overview & Tutorial](https://overlastic.vercel.app/en/vue/)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@overlastic/vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/hairyf/overlastic#readme",
|
|
7
7
|
"repository": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"pascal-case": "3.1.2",
|
|
30
30
|
"vue": "^3.3.2",
|
|
31
31
|
"vue-demi": ">=0.14.7",
|
|
32
|
-
"@overlastic/core": "^0.5.
|
|
32
|
+
"@overlastic/core": "^0.5.1"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"build": "tsup src/index.ts",
|