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 ToastCode component for interactive playground code generation #45

Merged
merged 1 commit into from
Dec 17, 2023

Conversation

marquaye
Copy link
Contributor

@marquaye marquaye commented Dec 17, 2023

Motivation

I really enjoy using your library but I didn't immediately understand how the API works (although your documentation is great!).
As a convenience function I created a ToastCode Component for the playground to get the actual code for the toast in a WYSIWYG manner.

With this minor addition it will be much easier for others to understand how the toast is working.
Just copy and paste the code.

Limitations

I only implemented the toast options. For the container options I would have to change the data flow from the conditions component to get the info into the new ToastCode component.
This would be a great improvement for another time.

Changes to the code

  • added new Vue-Component ToastCode.vue
  • added 'highlight.js/lib/core';
  • added 'highlight.js/lib/languages/javascript';
  • added 'highlight.js/styles/monokai.css';

I hope you can use this code and thanks again for creating this library!

@jerrywu001 jerrywu001 merged commit a53a56c into jerrywu001:main Dec 17, 2023
8 checks passed
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.

2 participants