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

Remove watcher and maybe add example for refs usage #354

Open
langehm opened this issue Dec 8, 2024 · 2 comments · May be fixed by #355
Open

Remove watcher and maybe add example for refs usage #354

langehm opened this issue Dec 8, 2024 · 2 comments · May be fixed by #355
Assignees

Comments

@langehm
Copy link
Contributor

langehm commented Dec 8, 2024

          This could be done without a watcher using [vue refs](https://vuejs.org/guide/essentials/template-refs).

We should minimize the amount of watcher we introduce with components!

Originally posted by @langehm in #345 (comment)

@langehm langehm self-assigned this Dec 8, 2024
@langehm langehm changed the title Add example to delete warnings without watcher Remove watcher and maybe add example for refs usage Dec 8, 2024
@langehm
Copy link
Contributor Author

langehm commented Dec 8, 2024

There is also sth wrong with the formating in the mucfiledropzone component - see in picture:
grafik

@langehm
Copy link
Contributor Author

langehm commented Dec 9, 2024

Usage could look like this:

<template>
  <muc-button @click="clearWarnings">Reset </muc-button>
  <muc-file-dropzone ref="dropZone" button-text="Dokument hochladen" max-file-size="1" maxFileSizeWarning="Eine Datei hat mehr als 2 MB und kann nicht angefügt werden." />
</template>
<script>
import { useTemplateRef } from 'vue';

const dropZone = useTemplateRef('dropZone');

const clearWarnings = () => dropZone.value.clearWarnings();
</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 a pull request may close this issue.

1 participant