众所周知,vue在beforecreate时期是获取不到data中的 数据的
但是通过一些方法可以实现在beforecreate时获取到data中的数据
暂时想到两种放发可以实现,vue在beforecreate时获得data中的数据
异步获取即:通过 $this.$nextTick或者settimeout,这连dom都可以拿出来beforeCreate() {this.$nextTick(function() {console.log(this.属性名);})}
2、同步获取:在beforeCreate之前,所有的iptions都会先存到vm.$options中,也就是说使用this.$options.data就行了