Skip to content

Commit

Permalink
fix: wrong function name & null ctx case
Browse files Browse the repository at this point in the history
  • Loading branch information
daief committed Feb 19, 2022
1 parent c766913 commit 12f1c8f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ export * from './icons';

export * from './shared/ctx';

export { install as default, installContenxt } from './install';
export { install as default, installContext } from './install';

export const version = VERSION;
4 changes: 2 additions & 2 deletions src/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function install(
...options,
};

installContenxt(app);
installContext(app);

[all, icons].forEach((set) => {
Object.keys(set).forEach((key) => {
Expand All @@ -27,7 +27,7 @@ export function install(
});
}

export function installContenxt(app: App) {
export function installContext(app: App) {
const ctx: IDaisyuiVueContext = reactive({
styles: createStyles(),
});
Expand Down
2 changes: 1 addition & 1 deletion src/shared/styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function component<Attrs = unknown, P = {}>(
return defineComponent({
...(options as any),
setup: (props, ctx) => {
useDaisyui().styles.insertCss(styles);
useDaisyui()?.styles.insertCss(styles);
// @ts-ignore
return options.setup(props, ctx);
},
Expand Down

0 comments on commit 12f1c8f

Please sign in to comment.