npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

monaco-editor-vue2-log

v1.0.5

Published

基于monaco-editor的vue2日志log组件

Downloads

9

Readme

monaco-editor-vue2-log

安装:

npm install monaco-editor-vue2-log

用法:

 <MonacoEditorVue2Log
      :title="title"
      :value="value"
      :readOnly="readOnly"
      :keywordsStyle="keywordsStyle"
      :scrollToBottomVisible="scrollToBottomVisible"
      @editorValue="getEdtiorValue"
      ref="editor"
  ></MonacoEditorVue2Log>

属性:

| 属性 | 描述 | 默认值 | | --------------------- | -------------------------------------- | ------------------- | | title | 标题 | 默认为空 | | value | 日志的内容 | 默认为空 | | readOnly | 日志是否只读(不可编辑),为true时只读 | 默认为false,可编辑 | | keywordsStyle | 关键字自定义样式、颜色 | 默认为空数组[] | | scrollToBottomVisible | 是否滚动到日志内容的最后一行 | 默认为false |

事件:

| 事件 | 描述 | | ----------- | -------------- | | editorValue | 获取编辑器的值 |

获取编辑器的值:

this.$refs['editor'].getValue()

示例代码:

  1. 在main.js文件中引入并注册MonacoEditorVue2Log
import "monaco-editor-vue2-log/style.css";
import MonacoEditorVue2Log  from "monaco-editor-vue2-log"
Vue.use(MonacoEditorVue2Log)
  1. 在组件中应用MonacoEditorVue2Log
<template>
  <div class="container">
    <MonacoEditorVue2Log
      :title="title"
      :value="value"
      :readOnly="readOnly"
	  :keywordsStyle="keywordsStyle"
	   :scrollToBottomVisible="scrollToBottomVisible"
      @editorValue="getEdtiorValue"
      ref="editor"
    ></MonacoEditorVue2Log>
  </div>
</template>
<script>
export default {
  name: 'App',
  data () {
    return {
      title: '日志log',
      value: `"name": "monaco-editor-vue2-log",
"version": "1.0.5",
"description": "基于monaco-editor的vue2日志log组件",
"main": "monaco-editor-vue2-log.js",
"scripts": {
  "test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
  "vue",
  "vue2",
  "log",
  "monaco-editor",
  "monaco",
  "editor"
],
"author": "ji.yaning",
"license": "ISC"`,
      readOnly: false,
      keywordsStyle:[
        { token: 'monaco', foreground: '#E5E510' },
        { token: 'editor', foreground: '#00EE76' },
        { token: 'vue', foreground: '#508ae1', fontStyle: 'bold' }
      ],
      scrollToBottomVisible: true,
    }
  },
  mounted () {
    this.$refs['editor'].getValue()
  },
  methods: {
    getEdtiorValue (value) {
      console.log('编辑器的值为', value)
    }
  },
}
</script>
<style>
.container{
  height: 400px;
}
</style>

示例效果:

支持关键字搜索、关键字自定义样式颜色:

示例

支持是否显示行号、换行、缩略图,支持全屏显示,支持滚动到日志内容的最后一行:

示例