vue-modal-router
elegant to manage spa modals
0.6.0
- async modal support
modals: import'./test/async-modal.vue' methods: { this$modalRouter }
0.5.1
- add modalRouter.closeAll()
- fix close custom modal bug
methods: { this$modalRouter }
0.5.0
- add modalRouter.close() method
const mid = this$modalRouter; this$modalRouter;
Breaking Change
- 0.4.0 is differenet to 0.3.x
- [delay] and [model] is config in Vue.use()
- suport component level modals,friendly for dyamicImport,to impress performance
install
npm install vue-modal-router
vue-modal-router
use modals like vue-router style way
install
modal component
<!-- your modal component --> something test
App.vue
<!-- modal placeholder -->
;; ;Vue; const modalRouter = CustomEdit // now modal name can be 'CustomEdit' or 'custom-edit',it will try pascal name; el: "#app" modalRouter;
then in page component
<!-- button to open modal --> open custom edit modal
pass props to modal
<!-- button to open modal --> open custom edit modal
with event
<!-- button to open modal --> open custom edit modal
use manual api to open a modal
open
dyamic modals,now you can import modals only in component what you need no need to import all modals at ones
<!-- button to open modal here will use `modals` config --> open custom edit modal
Development Setup
# install deps npm install # serve demo at localhost:8080 npm run dev # build library and demo npm run build # build library npm run build:library # build demo npm run build:demo
License
Copyright (c) 2018 FlynnLee