add iframe demo
This commit is contained in:
@@ -17,6 +17,7 @@
|
|||||||
"globby": "^11.0.0",
|
"globby": "^11.0.0",
|
||||||
"gridsome": "0.7.23",
|
"gridsome": "0.7.23",
|
||||||
"gridsome-plugin-simple-analytics": "^1.1.0",
|
"gridsome-plugin-simple-analytics": "^1.1.0",
|
||||||
|
"iframe-resizer": "^4.3.1",
|
||||||
"portal-vue": "^2.1.7",
|
"portal-vue": "^2.1.7",
|
||||||
"raw-loader": "^4.0.2",
|
"raw-loader": "^4.0.2",
|
||||||
"react": "^17.0.1",
|
"react": "^17.0.1",
|
||||||
|
|||||||
@@ -8,5 +8,6 @@
|
|||||||
${app}
|
${app}
|
||||||
${scripts}
|
${scripts}
|
||||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@docsearch/js@alpha"></script>
|
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@docsearch/js@alpha"></script>
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.2.11/iframeResizer.contentWindow.min.js" integrity="sha512-FOf4suFgz7OrWmBiyyWW48u/+6GaaAFSDHagh2EBu/GH/1+OQSYc0NFGeGeZK0gZ3vuU1ovmzVzD6bxmT4vayg==" crossorigin="anonymous"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import 'prismjs/components/prism-jsx.js'
|
|||||||
import 'prismjs/components/prism-typescript.js'
|
import 'prismjs/components/prism-typescript.js'
|
||||||
import 'prismjs/components/prism-scss.js'
|
import 'prismjs/components/prism-scss.js'
|
||||||
import PortalVue from 'portal-vue'
|
import PortalVue from 'portal-vue'
|
||||||
|
import iframeResize from 'iframe-resizer/js/iframeResizer'
|
||||||
import App from '~/layouts/App'
|
import App from '~/layouts/App'
|
||||||
|
|
||||||
Prism.manual = true
|
Prism.manual = true
|
||||||
@@ -20,6 +21,16 @@ export default function (Vue, { head }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Vue.use(PortalVue)
|
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('Layout', App)
|
||||||
Vue.component('Demo', () => import(/* webpackChunkName: "demo" */ '~/components/Demo'))
|
Vue.component('Demo', () => import(/* webpackChunkName: "demo" */ '~/components/Demo'))
|
||||||
Vue.component('LiveDemo', () => import(/* webpackChunkName: "live-demo" */ '~/components/LiveDemo'))
|
Vue.component('LiveDemo', () => import(/* webpackChunkName: "live-demo" */ '~/components/LiveDemo'))
|
||||||
|
|||||||
@@ -13,6 +13,14 @@
|
|||||||
</app-section>
|
</app-section>
|
||||||
|
|
||||||
<app-section>
|
<app-section>
|
||||||
|
<iframe
|
||||||
|
v-resize
|
||||||
|
src="demos/Examples/CollaborativeEditing"
|
||||||
|
style="background-color: white; border-radius: 8px;"
|
||||||
|
width="100%"
|
||||||
|
height="400"
|
||||||
|
frameborder="0"
|
||||||
|
/>
|
||||||
<demo name="Examples/CollaborativeEditing" :show-source="false" inline />
|
<demo name="Examples/CollaborativeEditing" :show-source="false" inline />
|
||||||
</app-section>
|
</app-section>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="demo-page">
|
<div class="demo-page">
|
||||||
<demo :name="$context.name" :show-source="false" />
|
<demo :name="$context.name" :show-source="false" inline />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.demo-page {
|
.demo-page {
|
||||||
max-width: 40rem;
|
// max-width: 40rem;
|
||||||
margin: 2rem auto;
|
// margin: 2rem auto;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8121,6 +8121,11 @@ iferr@^0.1.5:
|
|||||||
resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501"
|
resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501"
|
||||||
integrity sha1-xg7taebY/bazEEofy8ocGS3FtQE=
|
integrity sha1-xg7taebY/bazEEofy8ocGS3FtQE=
|
||||||
|
|
||||||
|
iframe-resizer@^4.3.1:
|
||||||
|
version "4.3.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/iframe-resizer/-/iframe-resizer-4.3.1.tgz#7aca964ac02ba1fd2b8099b8ef30bc9a1f4f72ca"
|
||||||
|
integrity sha512-PkoTPNF6EYhTbDjogdKu7JVgKqRwwNBXMeywZaQyzEYM3BNltA8O9fIIrtUkmj+8VZGckXpwtXsWsaQ5lrhd0w==
|
||||||
|
|
||||||
ignore-walk@^3.0.1:
|
ignore-walk@^3.0.1:
|
||||||
version "3.0.3"
|
version "3.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.3.tgz#017e2447184bfeade7c238e4aefdd1e8f95b1e37"
|
resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.3.tgz#017e2447184bfeade7c238e4aefdd1e8f95b1e37"
|
||||||
|
|||||||
Reference in New Issue
Block a user