代码必要的注我释

vue 文件方法声明的顺序:

-components -
  props -
  data -
  computed -
  created -
  mounted -
  activited -
  update -
  beforeRouteUpdate -
  methods -
  watch;

vue.js组件注释:

/*!
 * Vue.js v2.6.10
 * (c) 2014-2019 Evan You
 * Released under the MIT License.
 */

JQ 注释:

// jQuery的文件注释
/*!
 * jQuery JavaScript Library v1.11.3
 * http://jquery.com/
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 *
 * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
 * Released under the MIT license
 * http://jquery.org/license
 *
 * Date: 2015-04-28T16:19Z
 */

js 的注释,常见的代码注释有:

  • // 单行注释
  • /** **/ 多行注释

json 文件里面的注释格式:

"_comment":"this is commets",
    "jsondata":{

        "注释":"注释",

        "注释":"注释"
    }

module 注释:

/** @module color/mixer */
/** The name of the module. */
export const name = "mixer";

/** The most recent blended color. */
export var lastColor = null;

/**
 * Blend two colors together.
 * @param {string} color1 - The first color, in hexadecimal format.
 * @param {string} color2 - The second color, in hexadecimal format.
 * @return {string} The blended color.
 */
export function blend(color1, color2) {}

// convert color to array of RGB values (0-255)
function rgbify(color) {}

export {
  /**
   * Get the red, green, and blue values of a color.
   * @function
   * @param {string} color - A color, in hexadecimal format.
   * @returns {Array.<number>} An array of the red, green, and blue values,
   * each ranging from 0 to 255.
   */
  rgbify as toRgb,
};

常见的注释标签:

/**
 * @author  作者,方便定位
 * @class(同义词:@constructor)标记类和构造函数
 * @constant @const常量标记
 * @description(同义词:@desc) 对内容进行描述
 * @module 模块名称
 * @enum 枚举类型标记
 * @global 全局对象标记
 * @param 函数参数标记
 * @returns(同义词:@return)函数返回标记
 * @this this指向标记
 * @see 参考链接
 * @memberof 标记模块间的从属关系
 * @event 在模板中标记可以被触发的事件,与@fire配合使用
 * @alias 将成员视为具有不同的名称。
 * @Async 表示函数是异步的。
 * @augments(同义词:@extends)指示符号从父符号继承并添加到父符号。
 * @borrows 此对象使用来自另一个对象的内容。
 * @callback 回调函数。
 * @copyright 版权信息。
 * @default (同义词: @defaultvalue) 默认值。
 * @example 示例。
 */
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

柚子·小哥哥

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值