Skip to content

改进relaxProps和@Action

Latest
Compare
Choose a tag to compare
@hufeng hufeng released this 25 Dec 09:28
· 4 commits to master since this release

@action支持默认值,默认就是函数名称

class HelloActor extends Actor {
   //action name is update
   @Action()
   update(state) {}
}

在relax的props的彻底的数组实现,新的默认规则,

static relaxProps = [
 'hello', //默认名字一样 hello 
  ['goodsList',0, 'goods'], //默认使用最后的一个名字,goods  
  helloQL, //取QL('name'), 比如:helloQL 
  helloPQL, //取PQL('name'), 比如:helloPQL
 ]

感谢@dr2009杨兴洲同学的pr。