路泰科技体检小程序UI设计新版本
1
wwl
5 天以前 a6cdbcfe28fcc40ebb4919f57d60fb20122e8e57
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/**
 * @description 插件构建文件模板
 */
 
module.exports = {
  /**
   * @description 入口文件
   * @type {String}
   * @default 'index.js'
   */
  main: 'index.js',
  /**
   * @description 支持的平台
   * @type {String[]}
   * @default ['mp-weixin','mp-qq','mp-baidu','mp-alipay','mp-toutiao','uni-app']
   */
  platform: ['mp-weixin', 'mp-qq', 'mp-baidu', 'mp-alipay', 'mp-toutiao', 'uni-app'],
  /**
   * @description 要被添加到模板文件中的标签(将被添加到 src/node/node.wxml)
   * 必须要有 wx:if 表明什么情况下使用该标签
   * n 表示标签结构体,<node> 标签用于递归显示子节点(可参考源文件中的写法)
   * @type {String}
   */
  template: '',
  /**
   * @description 用于处理模板中事件的方法(将被添加到 src/node/node.js)
   * 需要触发顶层组件的事件请使用 this.root.triggerEvent
   * @type {Object}
   */
  methods: {
 
  },
  /**
   * @description 用于模板文件的 css 样式(将被添加到 src/node/node.wxss)
   * @type {String}
   */
  style: '',
  /**
   * @description 要被引入到模板文件的 css 文件路径(将被添加到 src/node/node.wxss)
   * @type {String|String[]}
   */
  import: [],
  /**
   * @description 在模板中需要使用的组件或插件列表(将被添加到 src/node/node.json)
   * @type {Object}
   */
  usingComponents: {
 
  },
  /**
   * @description 自定义文件处理器
   * 如果上述处理还无法满足要求,可以在此方法中进行处理
   * 所有 src 目录下的文件和本插件目录下的文件都会经过此方法的处理
   * @param {Vinyl} file 关于该文件对象的格式可参考 https://github.com/gulpjs/vinyl#instance-methods
   * @param {String} platform 平台
   */
  handler (file, platform) {
    let content = file.contents.toString()
    // 进行处理
    if (platform === 'xxx') {
      content = content.replace('aaa', 'bbb')
    }
    file.contents = Buffer.from(content)
  }
}