How to use the omi.$$ function in omi

To help you get started, we’ve selected a few omi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Tencent / omi / md2site / template / app / src / component / content / index.js View on Github external
initCodeStyle() {
        let codes = Omi.$$("code");
        let codeHlNumArr = [];
        codes.forEach(code => {
            hljs.highlightBlock(code);
            let arr = code.className.match(/{\S*}/);
            let hllNums = null;
            if (arr) {
                let numArr = arr[0].replace(/[{|}]/g, '').split(',');
                hllNums = this._arrToNumber(numArr);
            }
            codeHlNumArr.push(hllNums);
        })

        highlightLines();

        codes.forEach((code, index) => {
            this._hll(code, codeHlNumArr[index])
github Tencent / omi / docs / old-bak / src / component / content / index.js View on Github external
initCodeStyle() {
        let codes = Omi.$$("code");
        let codeHlNumArr = [];
        codes.forEach(code => {
            hljs.highlightBlock(code);
            let arr = code.className.match(/{\S*}/);
            let hllNums = null;
            if (arr) {
                let numArr = arr[0].replace(/[{|}]/g, '').split(',');
                hllNums = this._arrToNumber(numArr);
            }
            codeHlNumArr.push(hllNums);
        })

        highlightLines();

        codes.forEach((code, index) => {
            this._hll(code, codeHlNumArr[index])
github Tencent / omi / md2site / template / app / src / component / content / index.js View on Github external
_hll(code, hllNums){
        let spans = Omi.$$('.line',code);
        hllNums&&hllNums.forEach(num =>{
            spans[num]&&spans[num].classList.add('highlight');
        })
    }
github Tencent / omi / docs / old-bak / src / component / content / index.js View on Github external
_hll(code, hllNums){
        let spans = Omi.$$('.line',code);
        hllNums&&hllNums.forEach(num =>{
            spans[num]&&spans[num].classList.add('highlight');
        })
    }

omi

<p align="center"><img src="https://omijs.github.io/home/assets/logo.svg" alt="omi" width="100"/></p> <h2 align="center">Omi - Web Components Framework</h2>

MIT
Latest version published 16 days ago

Package Health Score

76 / 100
Full package analysis