#issue地址
vue
{
{
}
}
中不支持复杂的 js
语法,由于 mpvue
会把 {
{
}
}
中的内容直接编译到 wxml
中,受限于微信小程序的能力。slot
,具名 slot
和单个 slot
插槽能够支持,可是 slot
的 scoped
不支持,即下面的状况没法获取 item
和 index
<component v-for="item in todos" :key="item">
{{ item }} /* 获取不到 */
</component>
复制代码
slider
,想要在拖动的时候实时修改标题,可是会不断地从新赋值为 chapterIndex
的值,就会出现回弹的 bug
,并且松手后的 value
不是最新的 value
,而是 chapterIndex
(下面注释部分为解决方案)。scroll-view
若是动态绑定 scrolltop
也有一样的问题。// 假设如今chapterIndex为0,slider最大为10
<slider :value="chapterIndex"
@changing="sliderChooseChaptering"
@change="sliderChooseChaptered">
// 拖动slider到5处
sliderChooseChaptering(e) {
// this.chapterIndex = undefined; // 经过设置为undefined能够避免滚动条回退
this.toolbarTitle = 'new title'; // 改动了标题变量,可是slider会被从新赋值,小圆点回退到0处
},
sliderChooseChaptered(e) {
let chapterIndex = e.mp.detail.value;
console.log(chapterIndex); // 值为0,而不是5
// this.chapterIndex = chapterIndex; // 从新赋值
}
复制代码
pages/***/main
,如 pages/index/main
url
不能使用相对路径, 不然在手机上将显示不出来<image :src = 'imgUrl'></image>
imgUrl() {
return '../../static/images/test.png'; // 错误方法
return '/static/images/test.png'; // 正确方法
}
复制代码
scroll-view
中没法监听到垂直的 touchmove
(原生的也有一样的问题)<scroll-view style="height:100rpx" scroll-y @touchstart="tstart" @touchend="tend" @touchmove="tmove"><div style="height: 200rpx">hahahah</div></scroll-view>
tstart() {
console.log('tstart');
},
tend() {
console.log('tend');
},
tmove() {
console.log('tmove');
},
复制代码
:nickName.sync="nickName"
,当父组件的 nickName
改变时,子组件中的数据没有刷新$broadcast
下传事件了image
时可能会致使体验 bug
,出现场景:侧滑组件分上下两层,上层含有 image
标签,当快速加载多个侧滑组件时,会出现下层按钮闪现的状况(百来毫秒),下降体验感#issue
mpvue
组件化开发能力更强,wepy
组件化支持仍有不少不足,其中组件数据共享的问题简直鸡肋。虽然在1.7.2以后可使用原生的组件从而达到数据隔离的目的,可是原生语法和 wepy
语法很容易发生混淆。若是要循环渲染组件,则必定要用到 repeat
标签,而 repeat
标签自己充满着 bug
。vuex
,wepy
开发过程当中多页面间共享的数据很难维护,只能用 globaldata
或者 storage
来达到数据共享效果。vue
更加相似,wepy
只是借鉴了 vue
,自己和 vue
仍是有较大差异的。{
{
}
}
中不支持复杂的js语法,由于 mpvue
会把 {
{
}
}
中的内容直接编译到 wxml
中,受限于微信小程序的能力。slot
,具名 slot
和单个 slot
插槽能够支持,可是 slot
的 scoped
不支持,即下面的状况没法获取 item
和 index
<component v-for="item in todos" :key="item">
{{ item }} /* 获取不到 */
</component>
复制代码