add iframe demo
This commit is contained in:
committed by
Hans Pagel
parent
7eeb4265fd
commit
3d055a5111
@@ -3,6 +3,7 @@ import 'prismjs/components/prism-jsx.js'
|
||||
import 'prismjs/components/prism-typescript.js'
|
||||
import 'prismjs/components/prism-scss.js'
|
||||
import PortalVue from 'portal-vue'
|
||||
import iframeResize from 'iframe-resizer/js/iframeResizer'
|
||||
import App from '~/layouts/App'
|
||||
|
||||
Prism.manual = true
|
||||
@@ -20,6 +21,16 @@ export default function (Vue, { head }) {
|
||||
}
|
||||
|
||||
Vue.use(PortalVue)
|
||||
|
||||
Vue.directive('resize', {
|
||||
bind(el, { value = {} }) {
|
||||
el.addEventListener('load', () => iframeResize(value, el))
|
||||
},
|
||||
unbind(el) {
|
||||
el.iFrameResizer.removeListeners()
|
||||
},
|
||||
})
|
||||
|
||||
Vue.component('Layout', App)
|
||||
Vue.component('Demo', () => import(/* webpackChunkName: "demo" */ '~/components/Demo'))
|
||||
Vue.component('LiveDemo', () => import(/* webpackChunkName: "live-demo" */ '~/components/LiveDemo'))
|
||||
|
||||
Reference in New Issue
Block a user