Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jenesius-vue-modal

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jenesius-vue-modal - npm Package Compare versions

Comparing version 1.1.7 to 1.2.0

dist/jenesius-vue-modal.cjs.js

14

package.json
{
"name": "jenesius-vue-modal",
"version": "1.1.7",
"version": "1.2.0",
"private": false,
"description": "Simple modal plugin for Vue3",
"author": "Jenesius",
"main": "plugin-dist/jenesius-vue-modal.cjs.js",
"main": "dist/jenesius-vue-modal.cjs.js",
"scripts": {

@@ -19,3 +15,3 @@ "serve": "vue-cli-service serve",

"files": [
"plugin-dist/jenesius-vue-modal.cjs.js",
"dist/jenesius-vue-modal.cjs.js",
"README.MD"

@@ -28,6 +24,8 @@ ],

"@babel/core": "^7.15.0",
"@babel/plugin-proposal-throw-expressions": "^7.14.5",
"@babel/plugin-transform-modules-commonjs": "^7.15.0",
"@babel/preset-env": "^7.15.0",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^20.0.0",
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-babel": "^4.5.13",
"@vue/cli-plugin-eslint": "~4.5.0",

@@ -34,0 +32,0 @@ "@vue/cli-plugin-unit-jest": "^4.5.13",

@@ -70,7 +70,12 @@ # Jenesius Vue Modal

---
Versions is higher than 1.2.0 **NOT support** 'next'. Now **All** hooks use only returned value(Boolean) for navigation hooks.
If function return **false** or throwing an Error modal window will not be closed.
---
- onclose
```js
const modal = await openModal(Modal);
modal.onclose = (next) => {
modal.onclose = () => {
console.log("Close");
return false; //Modal will not be closed
}

@@ -84,4 +89,8 @@ ```

props: {},
beforeModalClose(next){
console.log("Close")
data: () => ({isValidate: false}),
beforeModalClose(){
console.log("Close");
if (!isValidate) return false; //modal will not be closed while isValidate === false
}

@@ -94,4 +103,4 @@ }

setup() {
onBeforeModalClose(next => {
console.log("Close")
onBeforeModalClose(() => {
console.log("Close");
});

@@ -102,11 +111,3 @@ }

First parameter of each hook is `next` - callback can be run with `false` value for stop closing a modal window.
```js
export default {
props: {},
beforeModalClose(next){
next(false); // This modal can not be closed!
}
}
```
### Async/Await

@@ -116,8 +117,18 @@

```js
async beforeModalClose(next){
async beforeModalClose(){
await doSome();
next(true); // This modal can not be closed!
return false; // This modal can not be closed!
}
```
or
```js
beforeModalClose(){
return Promise(resolve => {
setTimeout(() => resolve(true), 2000); //Modal will closed after 2 second
})
}
```
# Example VueModalComponent

@@ -124,0 +135,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc