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

Add Vue export (#2145) #2151

Merged
merged 1 commit into from
Oct 15, 2023
Merged

Add Vue export (#2145) #2151

merged 1 commit into from
Oct 15, 2023

Conversation

brtinney
Copy link
Contributor

Adds an export to be able to reference the Vue file.

@brtinney brtinney mentioned this pull request Oct 13, 2023
@arnog
Copy link
Owner

arnog commented Oct 15, 2023

Thanks for the PR!

@arnog arnog merged commit 6102050 into arnog:master Oct 15, 2023
@digitalboy
Copy link

Uncaught (in promise) TypeError: this.$el.setOptions is not a function at Proxy.<anonymous> (vue-mathlive.mjs:2:632)

My VUE code

<!-- MathLiveComponent.vue -->
<template>
    <mathlive-mathfield :id="mathfieldId" :value="mathFieldValue" :options="mathFieldOptions" @input="onInput">
    </mathlive-mathfield>
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue';
import MathLiveVue from 'mathlive/vue';

export default defineComponent({
    name: 'MathLiveComponent',
    components: {
        'mathlive-mathfield': MathLiveVue
    },
    setup() {
        const mathfieldId = ref('mathfield');
        const mathFieldValue = ref('');
        const mathFieldOptions = ref({ /* ...options here... */ });

        const onInput = (event: Event) => {
            mathFieldValue.value = (event.target as HTMLInputElement).value;
        };

        return { mathfieldId, mathFieldValue, onInput, mathFieldOptions };
    },
});
</script>

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

Successfully merging this pull request may close these issues.

3 participants