feat: separate Base bubble
Also added a provider to inject local variant and orientation state to child components
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { inject, provide } from 'vue';
|
||||
|
||||
const MessageControl = Symbol('MessageControl');
|
||||
|
||||
export function useMessageContext() {
|
||||
const context = inject(MessageControl, null);
|
||||
if (context === null) {
|
||||
throw new Error(`Component is missing a parent <Message /> component.`);
|
||||
}
|
||||
|
||||
return { ...context };
|
||||
}
|
||||
|
||||
export function provideMessageContext(context) {
|
||||
provide(MessageControl, context);
|
||||
}
|
||||
Reference in New Issue
Block a user