Skip to content

Add Vue example - #42

Open
dflock wants to merge 1 commit into
speed-highlight:mainfrom
dflock:add-vue-example
Open

Add Vue example#42
dflock wants to merge 1 commit into
speed-highlight:mainfrom
dflock:add-vue-example

Conversation

@dflock

@dflock dflock commented Mar 27, 2024

Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown
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

Comment thread examples/vue/README.md
## Install

```console
$ pnpm i @speed-highlight/core

Copy link
Copy Markdown
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
Copy Markdown
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

lvolland added a commit to lvolland/core that referenced this pull request Aug 2, 2026
…d-highlight#42

follows the layout the repo already uses for node-require and node-ts-module,
which is what speed-highlight#42 did and this pr did not.

takes the theme import from speed-highlight#42 so the component carries its own styling, with
the path that resolves: dist/themes is not exported, themes/ is.

Co-authored-by: Duncan Lock <dlock@photonic.com>
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