czechitas / da-data-jakpsatsql

1 stars 9 forks source link

vue-highlight.js #1

Open pavel242242 opened 5 years ago

pavel242242 commented 5 years ago

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 commented 5 years ago

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

pavel242242 commented 5 years ago

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...