2018-09-21 20:17:48 +08:00

15 lines
350 B
TypeScript

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