行業(yè)新聞您的當(dāng)前位置:首頁(yè) > 行業(yè)新聞 wordpress 代碼高亮使用 highlight.js 突出顯示 Vue 中的代碼 2022-06-23 來(lái)源:www.bjcthy.com 使用 .js 突出顯示 Vue 中的代碼 VUE .js 當(dāng)有些網(wǎng)頁(yè)有在線編輯頁(yè)面時(shí)wordpress 代碼高亮wordpress網(wǎng)站制作,我們不希望每個(gè)代碼類型都一樣 1、高亮介紹wordpress 代碼高亮wordpress做網(wǎng)站,在main.js文件中全局導(dǎo)入 import Vue from 'vue' import App from './App.vue' import $ from 'jquery' import ElementUI from 'element-ui' import 'element-ui/lib/theme-chalk/index.css'; import router from "./router/index.js" import hljs from 'highlight.js'; import 'highlight.js/styles/googlecode.css' Vue.use(hljs) Vue.use(ElementUI); Vue.config.productionTip = false Vue.directive('highlight',function(el){ let highlight = el.querySelectorAll("pre code"); highlight.forEach((block) =>{ hljs.highlightBlock(block) }) }) new Vue({ router, render: h => h(App), }).$mount('#app') 文章來(lái)自互聯(lián)網(wǎng),侵權(quán)請(qǐng)聯(lián)系刪除,文章闡述觀點(diǎn)來(lái)自文章出處,并不代表本站觀點(diǎn)。 www.bjcthy.com 返回
wordpress 代碼高亮使用 highlight.js 突出顯示 Vue 中的代碼 2022-06-23 來(lái)源:www.bjcthy.com 使用 .js 突出顯示 Vue 中的代碼 VUE .js 當(dāng)有些網(wǎng)頁(yè)有在線編輯頁(yè)面時(shí)wordpress 代碼高亮wordpress網(wǎng)站制作,我們不希望每個(gè)代碼類型都一樣 1、高亮介紹wordpress 代碼高亮wordpress做網(wǎng)站,在main.js文件中全局導(dǎo)入 import Vue from 'vue' import App from './App.vue' import $ from 'jquery' import ElementUI from 'element-ui' import 'element-ui/lib/theme-chalk/index.css'; import router from "./router/index.js" import hljs from 'highlight.js'; import 'highlight.js/styles/googlecode.css' Vue.use(hljs) Vue.use(ElementUI); Vue.config.productionTip = false Vue.directive('highlight',function(el){ let highlight = el.querySelectorAll("pre code"); highlight.forEach((block) =>{ hljs.highlightBlock(block) }) }) new Vue({ router, render: h => h(App), }).$mount('#app') 文章來(lái)自互聯(lián)網(wǎng),侵權(quán)請(qǐng)聯(lián)系刪除,文章闡述觀點(diǎn)來(lái)自文章出處,并不代表本站觀點(diǎn)。 www.bjcthy.com 返回