h: 100%;
    height: 100%;
  }


</style>
<script>
  import { decodeImage } from '../_utils/decodeImage.js'
  import { coordsToPercent } from '../_utils/coordsToPercent.js'

  export default {
    async oncreate () {
      const { node } = this.refs
      try {
        await decodeImage(node)
      } catch (e) {
        console.error('Image decode error', node && node.src, e)
        this.set({ error: true })
      }
    },
    data: () => ({
      error: false,
      forceSize: false,
      fallback: undef