Comments (4)
文档里有明确说明不能用hash命名的吧
from mpx.
from mpx.
关联组件是指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.
如果是拼接成的路径,比如path = '../' + name + 'index',一些三方原生组件里面可能这么写(比如vant weapp),有什么解决方案么?
或者有什么配置项可以保证某一部分文件名称不变么
from mpx.
Related Issues (20)
- [Bug report] serve web ts报错 HOT 1
- [Bug report] 2.9.x版本 eslint 报错导致 serve 跑不起来 HOT 1
- [Bug report] `onLoad`, `onShow` and so on hooks not found in node_modules/@mpxjs/core/src/index.js HOT 3
- [Bug report] 最新的core类型声明为什么删除了对PropType类型的支持? HOT 1
- [Bug report]optimizeRenderRules 优化导致的bug HOT 2
- [Bug report] 使用setData更新数据时,某些场景会报错:TypeError: Cannot read property 'length' of null HOT 1
- web平台 onReachBottom 事件报错 HOT 1
- [Bug report]微信小程序不支持component动态引入组件 HOT 2
- 转 web 时 `scss` 通过 additionalData 引入的全局变量 px 不会被转化为 vw 或 rem HOT 1
- wx 转 web 时 externalClasses 不生效 HOT 3
- [Bug report] 每次打包都提示 Error: EBUSY: resource busy or locked, rmdir 'dist/wx' HOT 6
- [Bug report] 转 web时通过 js 引用图片时生成的 原子类代码会有乱码 HOT 1
- [Bug report] Skyline 模式下 worklet 函数写在 composition api 的 setup 中不被触发,写在 methods 中可以触发 HOT 4
- [Feature Request] 希望增加开关控制是否将 unocss 写的临时 px 值在编译结果里转换为 rpx HOT 8
- [Bug report]编译为支付宝小程序不会处理custom-tab-bar目录 HOT 1
- 微信 转 web 时使用 `relations` 建立组件关系,使用`getRelationNodes`获取关联组件报错 HOT 1
- [Bug report] 首次运行pnpm run serve出错 HOT 1
- [Bug report]初始化 npm run serve失败,用了楼上的方法仍然失败 HOT 2
- [Bug report]重新安装脚手架后无法create项目
- [Bug report] `mpx.xfetch`的TS类型报错 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mpx.