1.0.16 • Published 1 month ago

@mingyunsnpm/highlight v1.0.16

Weekly downloads
-
License
MIT
Repository
-
Last release
1 month ago

代码高亮插件

代码高亮插件,Reactvue 都可以使用,支持javascript json html css sql bash nginx 高亮

组件示例

import '@mingyunsnpm/highlight/build/style.css'
import ReactDOM from 'react-dom/client'
import Highlight from '@mingyunsnpm/highlight'

function App() {
  return (
    <Highlight>
      <pre>
        <code>console.log('test')</code>
      </pre>
    </Highlight>
  )
}

ReactDOM.createRoot(document.getElementById('root')!).render(<App />)

hooks 示例

import '@mingyunsnpm/highlight/build/style.css'
import ReactDOM from 'react-dom/client'
import { useHighlight } from '@mingyunsnpm/highlight'

function App() {
  useHighlight()
  return (
    <div className="container mx-auto">
      <pre>
        <code>console.log('test')</code>
      </pre>
    </div>
  )
}

ReactDOM.createRoot(document.getElementById('root')!).render(<App />)

方法调用示例

import '@mingyunsnpm/highlight/build/style.css'
import { highlight } from '@mingyunsnpm/highlight'

window.onload = function () {
  highlight()
}
1.0.16

1 month ago

1.0.15

3 months ago

1.0.14

3 months ago

1.0.13

3 months ago

1.0.9

3 months ago

1.0.11

3 months ago

1.0.10

3 months ago

1.0.12

3 months ago

1.0.8

3 months ago

1.0.7

5 months ago

1.0.6

5 months ago

1.0.5

5 months ago

1.0.4

5 months ago

1.0.3

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

6 months ago