若依VUE代码阅读

2020-02-27  本文已影响0人  爱读书的夏夏

文件: vue.config.js
该文件的作用:
https://www.jianshu.com/p/b358a91bdf2d
官方文档:https://cli.vuejs.org/zh/config/#vue-config-js

const defaultSettings = require('./src/settings.js')

读取工程下的settings.js中的配置。

文件: settings.js

module.exports = {
  title: 'Hulk 自动化',

  /**
   * 是否系统布局配置
   */
  showSettings: false,

  /**
   * 是否显示 tagsView
   */
  tagsView: true,

  /**
   * 是否固定头部
   */
  fixedHeader: false,

  /**
   * 是否显示logo
   */
  sidebarLogo: true,

  /**
   * @type {string | array} 'production' | ['production', 'development']
   * @description Need show err logs component.
   * The default is only used in the production env
   * If you want to also use it in dev, you can pass ['production', 'development']
   */
  errorLog: 'production'
}

看的时候,有挺多不明白的地方。比如一个变量直接使用了,不知道在哪里定义和赋值的。使用IDE的快捷键,找到定义的地方,但是存在于另一个文件中,而且看起来是其他模块中的,一脸懵逼。

上一篇 下一篇

猜你喜欢

热点阅读