2018-09-11 15:18:54 +08:00

15 lines
317 B
JavaScript

import { behavior } from './behavior';
import { observeProps } from './props';
export function observe(sfc) {
if (sfc.computed) {
sfc.behaviors.push(behavior);
sfc.methods = sfc.methods || {};
sfc.methods.$options = () => sfc;
if (sfc.properties) {
observeProps(sfc.properties);
}
}
}