Git Product home page Git Product logo

Comments (4)

hodgevk avatar hodgevk commented on August 18, 2024

文档里有明确说明不能用hash命名的吧

from mpx.

nan1010082085 avatar nan1010082085 commented on August 18, 2024

自动编译成的hash名
image
我想编译后也不是hash的

from mpx.

hiyuki avatar hiyuki commented on August 18, 2024

关联组件是指relations吗,这个我们提供了资源resolve能力来处理这种case,以微信的官方文档的示例举例:

// 在引用的资源路径后面加上?resolve就能得到该资源的目标路径
import customLiPath  from './custom-li?resolve'
Component({
  relations: {
    [customLiPath]: {
      type: 'child', // 关联的目标节点应为子节点
      linked(target) {
        // 每次有custom-li被插入时执行,target是该节点实例对象,触发在该节点attached生命周期之后
      },
      linkChanged(target) {
        // 每次有custom-li被移动后执行,target是该节点实例对象,触发在该节点moved生命周期之后
      },
      unlinked(target) {
        // 每次有custom-li被移除时执行,target是该节点实例对象,触发在该节点detached生命周期之后
      }
    }
  },
  methods: {
    _getAllLi() {
      // 使用getRelationNodes可以获得nodes数组,包含所有已关联的custom-li,且是有序的
      const nodes = this.getRelationNodes(customLiPath)
    }
  },
  ready() {
    this._getAllLi()
  }
})

这块文档写得不是很清楚,我们会尽快补齐

from mpx.

devinRex avatar devinRex commented on August 18, 2024

如果是拼接成的路径,比如path = '../' + name + 'index',一些三方原生组件里面可能这么写(比如vant weapp),有什么解决方案么?
或者有什么配置项可以保证某一部分文件名称不变么

from mpx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.