Skip to content

Commit

Permalink
feat(nuxt): add optionloadDefaultStyles with default true to togg…
Browse files Browse the repository at this point in the history
…le loading of default styles
  • Loading branch information
gravitano committed Jan 17, 2023
1 parent 452e3f9 commit aaa574d
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 4 deletions.
48 changes: 46 additions & 2 deletions packages/nuxt/playground/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const items = Array.from({length: 50}, (_, index) => ({
</script>

<template>
<div class="container mx-auto p-6 space-y-5">
<div class="container mx-auto p-6 pb-20 space-y-5">
<h1 class="text-2xl font-semibold">GITS UI Playground</h1>

<hr />
Expand Down Expand Up @@ -77,13 +77,57 @@ const items = Array.from({length: 50}, (_, index) => ({
<hr />
<h3 class="text-xl font-semibold">Select</h3>
<div>
<VSelect :items="items" />
<!-- <VSelect :items="items" /> -->
</div>

<hr />
<h3 class="text-xl font-semibold">Multi Select</h3>
<div>
<VMultiSelect :items="items" />
</div>

<hr />
<h3 class="text-xl font-semibold">Dropdown</h3>
<div>
<VDropdown
:items="[
{
text: 'Profile',
icon: 'mdi-account',
},
{
text: 'Settings',
icon: 'mdi-cog',
},
{
text: 'Logout',
icon: 'mdi-logout',
},
]"
/>
</div>

<hr />
<h3 class="text-xl font-semibold">Menus</h3>
<div>
<ClientOnly>
<VMenus
:items="[
{
text: 'Profile',
to: '/',
},
{
text: 'Settings',
to: '/',
},
{
text: 'Logout',
to: '/',
},
]"
/>
</ClientOnly>
</div>
</div>
</template>
1 change: 0 additions & 1 deletion packages/nuxt/playground/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ import GitsUIModule from '..';

export default defineNuxtConfig({
modules: [GitsUIModule, '@nuxtjs/tailwindcss'],
ssr: false,
gitsUi: {},
});
4 changes: 3 additions & 1 deletion packages/nuxt/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ export interface ModuleOptions {
components?: boolean;
transpileDeps?: boolean;
loadFloatingVueStyles?: boolean;
loadDefaultStyles?: boolean;
}

export default defineNuxtModule<ModuleOptions>({
Expand All @@ -332,6 +333,7 @@ export default defineNuxtModule<ModuleOptions>({
components: true,
transpileDeps: true,
loadFloatingVueStyles: true,
loadDefaultStyles: true,
},
setup(options, nuxt) {
const runtimeDir = fileURLToPath(new URL('./runtime', import.meta.url));
Expand All @@ -357,7 +359,7 @@ export default defineNuxtModule<ModuleOptions>({
}

// load required styles when not using css bundle and not using sass bundle
if (!options.css && !options.sass) {
if (!options.css && !options.sass && options.loadDefaultStyles) {
nuxt.options.css.push('@gits-id/menu/dist/style.css');
nuxt.options.css.push('@gits-id/tooltip/dist/style.css');
nuxt.options.css.push('@gits-id/theme/transition.css');
Expand Down

0 comments on commit aaa574d

Please sign in to comment.