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 example #42

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

dflock
Copy link

@dflock dflock commented Mar 27, 2024

No description provided.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The filename has a typo

## Install

```console
$ pnpm i @speed-highlight/core
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to stick with npm in the installation guide for clarity

Comment on lines +6 to +12
const { content = '', lang = 'c' } = defineProps<{ content: string; lang: string }>()

const highlightedCode = ref('')

onMounted(async () => {
highlightedCode.value = await highlightText(content, lang)
})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not very familiar with Vue, but it seems like the code isn't reactive to updates in the props value. It might be better to make it reactive to the props

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.

None yet

2 participants