Skip to content

Commit

Permalink
feat: add current when tailwindcss config contains only number bp (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
pikax authored Jul 24, 2020
1 parent 2bdd42e commit 202f53a
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 16 deletions.
4 changes: 2 additions & 2 deletions docs/api/axios.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import { AxiosInstance } from "axios";
import { AxiosRequestConfig } from "axios";
import { AxiosResponse } from "axios";
import { ComputedRef } from "@vue/composition-api";
import { ComputedRef } from "@vue/runtime-core";
import { PromiseResultFactory } from "vue-composable";
import { Ref } from "@vue/composition-api";
import { Ref } from "@vue/runtime-core";

// Warning: (ae-forgotten-export) The symbol "MakeAxiosReturn" needs to be exported by the entry point index.d.ts
//
Expand Down
14 changes: 6 additions & 8 deletions docs/api/vue-composable.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import { ComputedRef } from "@vue/composition-api";
import { InjectionKey } from "@vue/composition-api";
import { PluginFunction } from "vue";
import { provide } from "@vue/composition-api";
import { Ref } from "@vue/composition-api";
import { UnwrapRef } from "@vue/composition-api";
import { ComputedRef } from "@vue/runtime-core";
import { InjectionKey } from "@vue/runtime-core";
import { Plugin as Plugin_2 } from "@vue/runtime-core";
import { provide } from "@vue/runtime-core";
import { Ref } from "@vue/runtime-core";
import { UnwrapRef } from "@vue/runtime-core";

// @public (undocumented)
export interface ArrayPaginationResult<T extends Array<any>>
Expand Down Expand Up @@ -378,8 +378,6 @@ export function getCssVariableFor(
name: string
): CssVariable;

// Warning: (ae-forgotten-export) The symbol "Plugin" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
export const hydrationPlugin: Plugin_2;

Expand Down
2 changes: 1 addition & 1 deletion packages/axios/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"typescript": "^3.9.7"
},
"peerDependencies": {
"@vue/composition-api": "^1.0.0-beta.2",
"@vue/runtime-core": "^3.0.0-rc.2",
"axios": "^0.19.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe("breakpointTailwindcss", () => {
})
).toBe(bk);

expect(useBreakpoint).toHaveBeenCalledWith({ sm: "(min-width: 123px)" });
expect(useBreakpoint).toHaveBeenCalledWith({ sm: 123 });
expect(provide).toHaveBeenCalled();
});

Expand Down Expand Up @@ -91,7 +91,7 @@ describe("breakpointTailwindcss", () => {
})
).toBe(bk);

expect(useBreakpoint).toHaveBeenCalledWith({ sm: "(min-width: 123px)" });
expect(useBreakpoint).toHaveBeenCalledWith({ sm: 123 });
expect(provide).toHaveBeenCalled();
});
});
Expand Down
3 changes: 1 addition & 2 deletions packages/vue-composable/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"vue": "^2.6.10"
},
"peerDependencies": {
"@vue/composition-api": "^1.0.0-beta.2",
"vue": "^2.6.10"
"@vue/runtime-core": "^3.0.0-rc.2"
}
}
10 changes: 9 additions & 1 deletion packages/vue-composable/src/breakpoint/breakpointTailwind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,15 @@ export function setBreakpointTailwindCSS<T extends BreakpointObject>(
for (const k in bk) {
// istanbul ignore else
if (bk.hasOwnProperty(k)) {
bk[k] = screenToBreakpoint(bk[k]).join(" or ");
const v = bk[k];

if (isObject(v)) {
bk[k] = screenToBreakpoint(bk[k]).join(" or ");
} else if (isString(v)) {
if (!v.endsWith("px")) {
bk[k] = screenToBreakpoint(bk[k]).join(" or ");
}
}
}
}
}
Expand Down

0 comments on commit 202f53a

Please sign in to comment.