Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trying to use fitty with vue 3 and it does nothing with no error? #85

Open
L-o-o-t opened this issue Dec 11, 2022 · 2 comments
Open

trying to use fitty with vue 3 and it does nothing with no error? #85

L-o-o-t opened this issue Dec 11, 2022 · 2 comments

Comments

@L-o-o-t
Copy link

L-o-o-t commented Dec 11, 2022

it just doesn't want to work?
actually there is an error
TypeError: null is not an object (evaluating 'e3.element.parentNode.clientWidth')

--------------
<script setup>
import { RouterLink, RouterView } from 'vue-router'
import HelloWorld from './components/HelloWorld.vue'

</script>

<template>
  <header>
    <img alt="Vue logo" class="logo" src="@/assets/logo.svg" width="125" height="125" />

    <div class="wrapper">
      <HelloWorld msg="You did it!" />

      <nav>
        <RouterLink to="/">Home</RouterLink>
        <RouterLink to="/about">About</RouterLink>
      </nav>
    </div>
  </header>

  <RouterView />
  <div id="my-element" style="height: 100px;width: 400px">Hello World</div>
</template>
<script>
import fitty from 'fitty'
fitty('#my-element',{
  minSize: 16,
  maxSize: 300,
});
</script>
@aeon3k
Copy link

aeon3k commented Feb 24, 2023

did you find a solution ? @L-o-o-t

@pixlguru
Copy link

You have to put your fitty() into an onMounted / onUpdated hook

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants