UsingComponent

  • 自定义组件引用处理

使用示例

  1. useReducer({
  2. UsingComponent (node, store) {
  3. if (node.body.json) {
  4. // 组件名驼峰转中横杠格式
  5. }
  6. }
  7. });

编译结果示例

  • 编译前
  1. {
  2. "usingComponents": {
  3. "mpIcon": "../../components/icon/icon"
  4. }
  5. }
  • 编译后
  1. {
  2. "usingComponents": {
  3. "mp-icon": "./../../components/icon/icon"
  4. }
  5. }