vuejs / router

🚦 The official router for Vue.js
https://router.vuejs.org/
MIT License
3.84k stars 1.18k forks source link

docs: use vue-html for template examples #2056

Closed skirtles-code closed 9 months ago

skirtles-code commented 9 months ago

Using vue-html for the language of code blocks allows them to highlight Vue template syntax correctly. In particular, directive values are treated as JS expressions, rather than just HTML attributes:

Before After

In a few cases I've also changed vue to vue-html. Using vue as the language requires the surrounding <template> tag, otherwise it won't be highlighted correctly. vue-html treats the whole block as template syntax, even without a <template> tag.

It isn't always clear whether an example should be treated as vue-html or html. Some examples are using in-DOM templates and only part of the HTML should be treated as a template. In those few examples I left it as html.

I've made the same changes to the Chinese translation.

netlify[bot] commented 9 months ago

Deploy Preview for vue-router ready!

Name Link
Latest commit 19149b6e4102dea079449e75e2d1b87236dcc612
Latest deploy log https://app.netlify.com/sites/vue-router/deploys/65617f32fafbba00089d347c
Deploy Preview https://deploy-preview-2056--vue-router.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.