mirror of
https://github.com/KevinMidboe/vue-js-modal.git
synced 2025-10-29 18:00:20 +00:00
Minor refactoring
This commit is contained in:
@@ -1,10 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<modal name="foo">bar</modal>
|
<modal name="foo">Woot</modal>
|
||||||
|
<p>Hi from {{ name }}.</p>
|
||||||
|
|
||||||
<button @click="$modal.show('foo')">
|
<button @click="$modal.show('foo')">
|
||||||
Open modal
|
Open modal
|
||||||
</button>
|
</button>
|
||||||
<p>Hi from {{ name }}</p>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -17,3 +18,12 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
font-family: 'Avenir', Helvetica, Arial, sans-serif;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
color: #2c3e50;
|
||||||
|
padding: 50px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
3
dist/index.js
vendored
3
dist/index.js
vendored
@@ -95,7 +95,7 @@ var Plugin = {
|
|||||||
this.installed = true;
|
this.installed = true;
|
||||||
this.event = new Vue();
|
this.event = new Vue();
|
||||||
|
|
||||||
var $modal = {
|
Vue.prototype.$modal = {
|
||||||
show: function show(name, params) {
|
show: function show(name, params) {
|
||||||
Plugin.event.$emit('toggle', name, true, params);
|
Plugin.event.$emit('toggle', name, true, params);
|
||||||
},
|
},
|
||||||
@@ -107,7 +107,6 @@ var Plugin = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Vue.prototype.$modal = $modal;
|
|
||||||
Vue.component('modal', _Modal2.default);
|
Vue.component('modal', _Modal2.default);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
3
dist/ssr.index.js
vendored
3
dist/ssr.index.js
vendored
@@ -95,7 +95,7 @@ var Plugin = {
|
|||||||
this.installed = true;
|
this.installed = true;
|
||||||
this.event = new Vue();
|
this.event = new Vue();
|
||||||
|
|
||||||
var $modal = {
|
Vue.prototype.$modal = {
|
||||||
show: function show(name, params) {
|
show: function show(name, params) {
|
||||||
Plugin.event.$emit('toggle', name, true, params);
|
Plugin.event.$emit('toggle', name, true, params);
|
||||||
},
|
},
|
||||||
@@ -107,7 +107,6 @@ var Plugin = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Vue.prototype.$modal = $modal;
|
|
||||||
Vue.component('modal', _Modal2.default);
|
Vue.component('modal', _Modal2.default);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const Plugin = {
|
|||||||
this.installed = true
|
this.installed = true
|
||||||
this.event = new Vue()
|
this.event = new Vue()
|
||||||
|
|
||||||
const $modal = {
|
Vue.prototype.$modal = {
|
||||||
show (name, params) {
|
show (name, params) {
|
||||||
Plugin.event.$emit('toggle', name, true, params)
|
Plugin.event.$emit('toggle', name, true, params)
|
||||||
},
|
},
|
||||||
@@ -23,7 +23,6 @@ const Plugin = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Vue.prototype.$modal = $modal
|
|
||||||
Vue.component('modal', Modal)
|
Vue.component('modal', Modal)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user