didi/mpx 2572
Mpx,一款具有优秀开发体验和深度性能优化的增强型小程序开发框架
2017应届生入职前自学作业提交
web版本的@功能实现/Web version of @function implementation
mpx的eslint解析器
pagnkelly/30-seconds-of-code 0
Curated collection of useful Javascript snippets that you can understand in 30 seconds or less.
小程序动画库
Get the first element or first n elements of an array.
startedwebpack/schema-utils
started time in 3 hours
startedleafac/kill-the-newsletter.com
started time in 6 hours
startedpmndrs/valtio
started time in a day
startedLukeLin/js-stl
started time in 2 days
startednatemoo-re/microsite
started time in 2 days
startedspatie/ray
started time in 2 days
issue openedmpx-ecology/mpx-cli
vue-cli-plugin-mpx-web 增加配置
// 对于 svg 交给 mpx-url-loader 处理,去掉 vue-cli 内置的 file-loader
webpackConfig.module
.rule('svg')
.test(/\.svg$/)
.uses
.delete('file-loader')
created time in 2 days
issue closeddidi/mpx
[Feature Request] button组件转换支持新的open-type
起因:
百度进行非兼容性改造,https://smartprogram.baidu.com/forum/topic/show/125547,
将swan.login接口下线,改为需要用户触发button进行登录,新增了一个open-type类型,参考:
https://smartprogram.baidu.com/docs/develop/component/formlist_button/
因此需要mpx官方做一下兼容,查找了源程序应该是下面这个:
https://github.com/didi/mpx/blob/2ec98bdbb3d263fa179e80bebb1d0cc309a64e64/packages/webpack-plugin/lib/platform/template/wx/component-config/button.js#L62-L71
希望官方尽快兼容一下!!
closed time in 2 days
vivinePR closed didi/mpx
pr closed time in 2 days
pull request commentdidi/mpx
迁移到https://github.com/didi/mpx/pull/709
comment created time in 2 days
startedimmerjs/immer
started time in 2 days
startedfiles-community/Files
started time in 2 days
startedwebpack/tooling
started time in 2 days
startedsdushantha/tmpsms
started time in 2 days
issue closeddidi/mpx
父组件嵌套子组件,在子组件上声明ref属性为‘ddd’,父组件对应的ref属性为undefined(this.$refs.ddd) 代码如下
<template minapp='native' xlang='wxml'>
<view class='container'>
{{ids}}
</view>
</template>
<script>
import { createComponent } from '@mpxjs/core';
createComponent({
properties: {},
data: {
},
properties:{
ids:{
type:Number,
value:99999
}
},
methods: {},
});
</script>
<style lang='css'>
.container {
}
</style>
<script type='application/json' lang='json'>
{
"component": true
}
</script>
list.mpx
<template>
<view
class="list"
wx:ref="aaa"
>
<view
wx:for="{{listData}}"
wx:key="index"
>{{item}}
</view>
</view>
<view>222</view>
<dia
wx:ref="ddd"
ids="{{ids}}"
/>
</template>
<style lang="stylus">
.list {
background-color: red;
}
</style>
<script>
import { createComponent } from '@mpxjs/core';
createComponent({
data: {
ids: 9999,
},
properties: {
listData: {
type: Array,
value: ['手机', '电视', '电脑'],
},
},
methods: {
updListData() {
this.listData = ['手机', 'mac', '平板'];
this.ids = 88888;
console.log(this);
setTimeout(() => {
console.log(this);
}, 100);
},
},
});
</script>
<script type="application/json">
{
"component": true,
"usingComponents": {
"dia":"@/components/d.mpx"
}
}
</script>
d.mpx
<template minapp='native' xlang='wxml'>
<view class='container'>
{{ids}}
</view>
</template>
<script>
import { createComponent } from '@mpxjs/core';
createComponent({
properties: {},
data: {
},
properties:{
ids:{
type:Number,
value:99999
}
},
methods: {},
});
</script>
<style lang='css'>
.container {
}
</style>
<script type='application/json' lang='json'>
{
"component": true
}
</script>
updListData() {
this.listData = ['手机', 'mac', '平板'];
this.ids = 88888;
console.log(this);
setTimeout(() => {
console.log(this);
}, 100);
}
这个函数console的结果如下图:
两个console 在父组件property改变后下一帧父组件的$refs.ddd属性才表现正常为d.mpx 组件实例,在模拟器中两个console表现均正常
closed time in 3 days
tliwylissue commentdidi/mpx
我用的是华为p30,您给的截图是page中的获取ref这个是没问题的,我说的component中获取ref会有问题。最近项目有点忙,回复有点慢。暂时用selecComponent 解决问题了
如下 demo 所示,在所有平台的小程序,在 attached 中都获取不到 $refs,可以把 attached 改为 ready 再获取 $refs。
另外,$refs 内部实际上就是执行 this.selectComponent 获取节点实例,不过头条小程序的this.selectComponent 变为异步函数了,所以在开发者工具上也是获取不到对应的 ref 的。
<template>
<view class="list">
<aCom wx:ref="listRef" id="Jcom"></aCom>
</view>
</template>
<script>
createComponent({
data: {
listData: ['手机', '电视', '电脑'],
ids: 9999
},
attached () {
// 获取不到
console.log('listRef in ready: ', this.$refs.listRef)
},
ready () {
// 除头条小程外都可以获取到
console.log('listRef in ready: ', this.$refs.listRef)
// 只有头条小程序的 selectComponent 改成了异步函数
const jcom = this.selectComponent('#Jcom', res => {
console.log('selectComponent: ', res)
})
console.log('jcom: ', jcom)
}
})
</script>
comment created time in 3 days
push eventdidi/mpx
commit sha 45c4b70ae52abe5bc543d473b3c7def166e89cf5
little fix
push time in 3 days
PR opened didi/mpx
pr created time in 3 days
push eventdidi/mpx
commit sha 870c3deb8469f7fed33425a7321ad2a56d2f3974
深度遍历所有slot
commit sha 77c8aa87f592101cc35e5f2cf7a3f088473cbbb9
使用内建钩子
commit sha b141271bc37be957406f5de57d6a47effd6a48f7
使用内建钩子
commit sha e5ff41db98b356825f6b368080d8816d1d05a0ae
Merge remote-tracking branch 'origin/feat_realtions-web' into feat_realtions-web
push time in 3 days
issue openeddidi/mpx
选择的是swan平台,用watch 例子里面的listData无法渲染出来,用build就可以渲染出来
选择的是swan平台,用watch 例子里面的listData无法渲染出来,用build就可以渲染出来
以微信小程序为模版跨平台编译到swan,也是watch无法渲染出listData,build却可以
mpx版本v2.6.45,可以保证所有的包都是最新版本
电脑平台:mac
百度小程序开发工具版本:3.23.2
created time in 3 days
startedtailwindlabs/tailwindcss
started time in 3 days
push eventdidi/mpx
commit sha a0c4e1631bbdea559d5421f12a03b18d445fcf35
improvement(core/types): 优化推导方式
commit sha 6598bf35a1144d81629da6d156cef9a6bf3a18b8
Merge branch 'master' into fix_core_types
commit sha 213caa719f6809bbf5f33ac552b5f81f376fe132
Merge pull request #707 from didi/fix_core_types improvement(core/types): 优化推导方式
push time in 3 days
PR merged didi/mpx
pr closed time in 3 days
push eventdidi/mpx
commit sha 99d24fda62bfee7cc6e0f2160a58af3ae7e8fa3c
update components conversion rules
commit sha 9f1328de96c940b76bb1508799ff7bc72b1e600e
lint fix
commit sha 2e3296a36f6447b7861819c154980d646c66dd3d
输出h5 onLoad 钩子执行补充options参数
commit sha ed0615511270b9a9abc9064012fc84343a261f74
输出H5 app onLaunch 和 onShow 函数添加options
commit sha 9929dd0d10e86bb8395fd2f80da9dd67df0b7355
path 和 query 获取改为通过 mpxRouter
commit sha 86991afb10fc5bec38bcf33b7a0f1111f22b3bcf
current route 获取方式改为从 __mpxRouter.currentRoute
commit sha 8afb8f30f3b038171ffe4f5567c89785f5ad11f4
Merge branch 'master' of https://github.com/didi/mpx into fix-video
commit sha 9b42e7956a0d76ee215bae0926c8264ea0e00e89
fix conversion rules
commit sha 1c282b929f5029810bd2ef198722f2841eb36d13
fix lint
commit sha fda61a7debc3c3bc7d5326d0c456621add50e001
fix: add rigorous judgment
commit sha 5771fa892dcf54120d7d0b21f20253922875d29c
Merge branch 'master' into feat-add-h5-load-options
commit sha 82cb231f2d0841375539c462608a61e0bdbe2fb9
adjust HyphenTagName order
commit sha af01156ccf69d9aa1b00e845d056b2cd1de7c59d
Merge pull request #692 from didi/feat-add-h5-load-options 输出h5 onLoad 钩子执行补充options参数
commit sha 90e9a842927aa34caf090f86335afb1dd6eb5dca
Merge branch 'master' into fix-component-conversion-rules
commit sha 85777f22bbdf448d6c4de6f9fe47816cd21fd557
Merge branch 'master' into fix_core_types
commit sha a6177052c7584f6774487da7ab3495764a87d052
Merge pull request #681 from didi/fix-component-conversion-rules Fix component conversion rules
commit sha d8dcd2e338ca810755779b6ab6c484a58fd413a2
Merge branch 'master' into fix_core_types
commit sha 59c3216529517b28de40e8508ec083e37a2ecc76
Merge pull request #674 from didi/fix_core_types feat(core/types): add chaining derivation support to mapState & mapGetters
commit sha 6598bf35a1144d81629da6d156cef9a6bf3a18b8
Merge branch 'master' into fix_core_types
push time in 3 days