JavaScript/vue.js/Provide Inject:修订间差异
来自康健生活
| 第46行: | 第46行: | ||
height: 0, | height: 0, | ||
} | } | ||
export const rectKey: InjectionKey<Reactive<IFRect>> = Symbol('rect') | export const rectKey: InjectionKey<Reactive<IFRect>> = Symbol('rect')</script> | ||
</syntaxhighlight>}} | </syntaxhighlight>}} | ||
| 第74行: | 第74行: | ||
import { DEFAULT_RECT, rectKey} from './config' | import { DEFAULT_RECT, rectKey} from './config' | ||
... | ... | ||
const rect = inject(rectKey, reactive(DEFAULT_RECT)) | const rect = inject(rectKey, reactive(DEFAULT_RECT))</script> | ||
</syntaxhighlight> | </syntaxhighlight> | ||