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

vue-highlight.js #1

Open
pavel242242 opened this issue Aug 19, 2019 · 2 comments
Open

vue-highlight.js #1

pavel242242 opened this issue Aug 19, 2019 · 2 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@pavel242242
Copy link
Collaborator

Asi jsem idiot, na lokale se mi to nepovedlo rozchodit.
sel jsem na to takhle:
npm install --save vue-highlightjs
pak jsem do main.js pridal:

import VueHighlightJS from "vue-highlightjs"
// Highlight.js languages (Only sql)
import sql from 'highlight.js/lib/languages/sql'
import javascript from 'highlight.js/lib/languages/javascript'

Vue.config.productionTip = false

Vue.use(VueHighlightJS, {
// Register only languages that we need
	languages: {
     sql,
     javascript
	}
})

a do tahak vue zkousel pridat
<highlight-code lang="sql"> Select * from terror where nkillter > 0; </highlight-code>
i
<pre v-highlightjs><code class="sql"> Select * from terror where nkillter > 0; </code></pre>

ale bez uspechu, pise mi to 'Unknown custom element: - did you register the component correctly?'

https://www.npmjs.com/package/vue-highlightjs

@pavel242242 pavel242242 added enhancement New feature or request help wanted Extra attention is needed labels Aug 19, 2019
@pavel242242
Copy link
Collaborator Author

pavel242242 commented Aug 20, 2019

aha, tak stacilo pridat require na cssko
zatim to mam na prasaka : require('../node_modules/highlight.js/styles/ir-black.css')

@pavel242242
Copy link
Collaborator Author

commitnuto, jen bude potreba do dependencies narvat vue-highlightjs a asi do assets vrazit ten ir-black.css, protoze ten je soucasti highlight.js, v tom vue-highlight jsem styly nenasel...

verope added a commit that referenced this issue Mar 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants