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

Can't seem to get fitty to work in a vue.js component. #63

Closed
toddpadwick opened this issue Aug 26, 2020 · 2 comments
Closed

Can't seem to get fitty to work in a vue.js component. #63

toddpadwick opened this issue Aug 26, 2020 · 2 comments

Comments

@toddpadwick
Copy link

I am trying to get fitty to run in vue js component and have imported the plugin, and am then running the method on the mounted() lifecycle hook. But its returning the reference error: fitty is not defined error.

Here is my code. do you know how I could get this working?

	<script>

		import Fitty from 'fitty'

		export default {
			name:'GhostHeadline',
			beforeCreate() {  

	        },
			props: {
				headline: {
					required:true,
					type:String
				}
			},
			mounted() {
				this.resizeHeadline();
			},
			methods: {
				resizeHeadline() {
					const headline = this.$refs.headline
					fitty(headline, {
						maxSize:1000
					})
				}
			}
		}
	</script>
@rikschennink
Copy link
Owner

rikschennink commented Aug 27, 2020

Maybe related to: #61

Also, in your snippet you're importing Fitty with a capital F instead of fitty.

@toddpadwick
Copy link
Author

You're right. it was just a stupid mistake on my part - Fitty with a capital F instead of lowercase. Thanks @rikschennink

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

2 participants