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.0.1 to 1.0.2

2

package.json
{
"name": "jenesius-vue-modal",
"version": "1.0.1",
"version": "1.0.2",
"private": false,

@@ -5,0 +5,0 @@ "description": "Simple modal",

@@ -8,2 +8,4 @@ # Jenesius Vue Modal

For add modals in your project you need to put the modal's container in the App component:
`App.vue`
```vue

@@ -33,3 +35,3 @@ <template>

```js
import useModal from "jenesius-vue-modal";
import {useModal} from "jenesius-vue-modal";

@@ -51,3 +53,3 @@ export default{

| `closeModal()` | Close all modals |
| `pushModal(VuewComponent, props)` | Add on top modal component |
| `pushModal(VueComponent, props)` | Add on top modal component |
| `popModal()` | Close the last modal component |

@@ -72,3 +74,3 @@

```js
import useModal from "jenesius-vue-modal"
import {useModal} from "jenesius-vue-modal"
import WidgeTestModal from "WidgeTestModal.vue";

@@ -75,0 +77,0 @@

@@ -18,3 +18,6 @@ import {ref, watch, shallowRef} from "vue";

let _modalId = 0;
const state = {
modalId: 0,
initialized: false
}

@@ -28,3 +31,2 @@ export const modalQueue = ref([]);

function closeById(id){

@@ -61,12 +63,17 @@ const indexFoRemove = modalQueue.value.findIndex(item => item.id === id);

_modalId++;
if (!state.initialized) {
throw `Modal Container not found. Put container from jenesius-vue-modal in App's template. Check documentation for more information https://www.npmjs.com/package/jenesius-vue-modal.`;
}
state.modalId++;
modalQueue.value.push({
component : shallowRef(component),
params : params,
id : _modalId
id : state.modalId
});
return ModalObject(_modalId);
return ModalObject(state.modalId);
}

@@ -85,13 +92,14 @@

export default () => ({
modalQueue,
export function useModal(){
return {
openModal,
closeModal,
openModal,
closeModal,
popModal,
pushModal,
}
}
popModal,
pushModal,
container: WidgetModalContainer
})
export function initialize(){
state.initialized = true;
}

Sorry, the diff of this file is not supported yet

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