本帖最後由 hihihi123hk 於 2019-9-24 23:57 編輯
點都好啦,AirBnb 而家係棄用 cross platform language 同 library 而回歸 iOS 同 Android 各自既 nativ ...
fx360bx 發表於 2019-9-24 23:02 
1. 變成
function Comp() {
const router = useRouter()
const style = useStyle()
return ...
}
2. 成個 Architecture 唔同,但 Vue Share code 方法有好多
1. Inject
Vue.use(FooPlugin) inject 落 global scope 直接
this.$xxxx.foo()
2. Mixin
export default {
...
mixins: [RefreshableMixin, LoggingMixin]
}
3. EventBus (Singleton)
const bus = new Vue()
bus.emit(xxx)
bus.onxxx
4. Inheritance (冇用過咁制
自己最常用係 1, 3
另外 Vue 最開心嘅地方係 Computed,可以用最 minimal states 無痛起好多 derived state(裝住啲 business logic)
via HKEPC IR Extreme 4.2.3 - iOS(4.0.2) |