Skip to content

v1.6.0

Choose a tag to compare

@caijf caijf released this 13 Jun 10:54
· 15 commits to main since this release
  • feat: 新增 countryCode2 方法

避免递归引用数据模板中的属性

参考 mockjs 代码片段

示例如下:

Mockjs.mock({
  "data|2-5": [{
      countryNameEn: "@country",
      countryName: "@ccountry",
      twoCode: "@countryCode(2)",
      countryCode: "@countryCode",
    }]
})

会导致 twoCode 的值都和 countryCode 字段一样。

改成下面这样就没问题:

Mockjs.mock({
  "data|2-5": [{
      countryNameEn: "@country",
      countryName: "@ccountry",
      twoCode: "@countryCode2",
      countryCode: "@countryCode",
    }]
})

Full Changelog: v1.5.1...v1.6.0