小程序不支持props,在小程序中无法通过props给子组件传递值。

 

this.$emit("getF",getForm)

如果getForm为函数

则父级:getF="getF“

getF为父级定义的方法,此时子级的getForm函数将作为参数传递给getF,为回调函数。\

 

小程序会过滤掉uni-forms里面的验证对象

可以通过内置的upi方法(标签上已加ref=”form“)

onReady(){

  this.$refs.form.setRules(rule) //rule为自己定义的规则

}

//Vue.mixin()定义的rule,就是vue里面的mixin

//Vue.use(userRuleMixin) #userRuleMixin是Vue.mixin()所在文件

 

posted on 2021-10-22 21:19  棋进制  阅读(927)  评论(0)    收藏  举报