New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

sx-log

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sx-log

将日志信息显示在页面上,便于调试

latest
npmnpm
Version
1.0.3
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

sx-log

将日志信息显示在页面上,便于调试

安装

npm i sx-log

组件说明

props

参数名类型默认值说明
logsArray[]数据集合

使用1 - 显示自定义的数据集合

<template>
  <div>
    <log :logs="logs" />
  </div>
</template>

<script>
 import Log from 'sx-log';

  export default {
    components: {
        Log
    },

    data() {
      return {
        logs: [
            1, // 可以是数字
            'string', // 可以是字符串
            {key: 'value'}, // 可以是对象
            [0,1,2,3,4],    // 可以是数组
        ],
      }
    }
  }
</script>

logs 可以是数字字符串对象数组等,但需为 JSON 格式

使用方式2 - 代替console.log, 记录控制台日志信息

main.js

import {addLog} from "sx-log";

console.log = addLog;

vue组件中调用

<template>
  <div>
    <!--不需要传参-->
    <log />
  </div>
</template>

<script>
 import Log from 'sx-log';

  export default {
    components: {
        Log
    }
  }
</script>

注意

logs 为数组格式,集合中的元素应为json数据

FAQs

Package last updated on 20 Sep 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts