0.0.7 • Published 2 years ago

vue3-iframe v0.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

vue3-iframe

Using Vue components inside iframes, commonly used for style isolation.

Demo

<template>
  <div class="outer">
    <button @click="onClick">outer btn</button>
    {{ count }}
    <Vue3Iframe
      class="border"
      :styles="['body{white-space: pre-wrap;overflow: hidden;margin:0}']"
    >
      <div style="padding: 20px">
        <button @click="onClick">inner btn</button>
        {{ count }}
      </div>
    </Vue3Iframe>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { Vue3Iframe } from '../../src'

const count = ref(0)

const onClick = () => {
  count.value++
}
</script>

<style lang="scss" scoped>
.outer {
  font-size: 20px;
  font-weight: bold;
}

.border {
  border: 1px solid #d9d9d9;
  border-radius: 4px;
}
</style>

Preview

Props

Propsdescriptiontypedefault
widthwidthstring'auto'
maxHeightmax heightstring'auto'
heightheightstring'auto'
inheritStyleswhether to inherit external stylesbooleanfalse
stylesstyle arraystring[][]
0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago