Skip to content

Commit

Permalink
fix(#190): fix import PropType
Browse files Browse the repository at this point in the history
  • Loading branch information
gravitano committed Nov 12, 2023
1 parent a5c55d6 commit 32c1bd2
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 88 deletions.
54 changes: 5 additions & 49 deletions packages/layouts/src/SidebarMenu.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import {PropType, toRefs} from 'vue';
import {type PropType, toRefs} from 'vue';
const props = defineProps({
isCollapsed: {
Expand All @@ -20,17 +20,7 @@ const {isCollapsed, menus} = toRefs(props);
<template v-if="menu.children && menu.children.length > 0">
<div
:key="idx"
class="
w-full
block
px-2
py-2
mt-3
uppercase
font-medium
rounded
text-xs text-gray-300
"
class="w-full block px-2 py-2 mt-3 uppercase font-medium rounded text-xs text-gray-300"
:class="{hidden: isCollapsed}"
>
{{ menu.title }}
Expand All @@ -39,37 +29,15 @@ const {isCollapsed, menus} = toRefs(props);
<template v-for="child in menu.children" :key="child.title">
<div
v-if="child.children && child.children.length > 0"
class="
w-full
block
px-2
py-2
uppercase
font-medium
mt-3
rounded
text-xs text-gray-300
"
class="w-full block px-2 py-2 uppercase font-medium mt-3 rounded text-xs text-gray-300"
:class="{hidden: isCollapsed}"
>
{{ child.title }}
</div>
<router-link
v-else
:to="child.to"
class="
text-gray-300
flex
hover:bg-blue-500
hover:text-gray-50
w-full
px-2
py-2
rounded
text-sm
transition
duration-500
"
class="text-gray-300 flex hover:bg-blue-500 hover:text-gray-50 w-full px-2 py-2 rounded text-sm transition duration-500"
:class="{'justify-center items-center rounded-lg': isCollapsed}"
>
<component
Expand All @@ -85,19 +53,7 @@ const {isCollapsed, menus} = toRefs(props);
<router-link
v-else
:to="menu.to"
class="
text-gray-300
flex
hover:bg-blue-500
hover:text-gray-50
w-full
px-2
py-2
rounded
text-sm
transition
duration-500
"
class="text-gray-300 flex hover:bg-blue-500 hover:text-gray-50 w-full px-2 py-2 rounded text-sm transition duration-500"
:class="{'justify-center items-center rounded-lg': isCollapsed}"
>
<component :is="menu.icon" v-if="menu.icon" class="w-5 h-5"></component>
Expand Down
16 changes: 2 additions & 14 deletions packages/menu/src/VMenuItem.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import VMenuTooltip from './VMenuTooltip.vue';
import {computed, PropType, resolveComponent} from 'vue';
import {computed, type PropType, resolveComponent} from 'vue';
import {Menu} from './types';
import {Icon} from '@iconify/vue';
Expand Down Expand Up @@ -53,19 +53,7 @@ const is = computed(() => props.as || resolveComponent('RouterLink'));
:is="is"
:to="item.to"
exact
class="
group
sub-menu
gap-x-3
w-full
px-2
py-2.5
rounded
flex
items-center
truncate
hover:bg-gray-100
"
class="group sub-menu gap-x-3 w-full px-2 py-2.5 rounded flex items-center truncate hover:bg-gray-100"
:class="[textColor, mini ? 'py-4' : '', centerClass]"
>
<span :class="mini ? '' : 'px-1 w-6'">
Expand Down
56 changes: 33 additions & 23 deletions packages/nav-drawer/src/deprecated/VNavDrawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ export default defineComponent({
</script>

<script setup lang="ts">
import { computed, onMounted, PropType, ref, toRefs, watch } from 'vue';
import VMenu, { type Menu } from '@morpheme/menu';
import {computed, onMounted, type PropType, ref, toRefs, watch} from 'vue';
import VMenu, {type Menu} from '@morpheme/menu';
import VLogo from '@morpheme/logo';
import { getBgColor } from '@morpheme/utils';
import VBtn from '@morpheme/button'
import Icon from '@morpheme/icon'
import {getBgColor} from '@morpheme/utils';
import VBtn from '@morpheme/button';
import Icon from '@morpheme/icon';
const props = defineProps({
modelValue: {
Expand All @@ -34,7 +34,7 @@ const props = defineProps({
logoProps: {
type: Object,
default: () => ({
imgClass: 'h-10'
imgClass: 'h-10',
}),
},
dark: {
Expand Down Expand Up @@ -75,15 +75,15 @@ const props = defineProps({
},
drawerClass: {
type: String,
default: ''
default: '',
},
transition: {
type: String,
default: 'v-nav-drawer-transition'
}
default: 'v-nav-drawer-transition',
},
});
const { modelValue, mini, isExpandHover, color, dark} = toRefs(props);
const {modelValue, mini, isExpandHover, color, dark} = toRefs(props);
const emit = defineEmits([
'update:modelValue',
Expand All @@ -92,24 +92,32 @@ const emit = defineEmits([
'update:expandHover',
]);
const isOpen = ref(modelValue.value)
const isOpen = ref(modelValue.value);
watch(modelValue, val => {
isOpen.value = val
}, { immediate: true })
watch(
modelValue,
(val) => {
isOpen.value = val;
},
{immediate: true},
);
const isMini = ref(mini.value)
const isMini = ref(mini.value);
watch(mini, val => {
isMini.value = val
}, { immediate: true })
watch(
mini,
(val) => {
isMini.value = val;
},
{immediate: true},
);
watch(isMini, val => {
watch(isMini, (val) => {
emit('update:mini', val);
})
});
const toggleMenu = () => {
isMini.value = !isMini.value
isMini.value = !isMini.value;
emit('toggle:click');
};
Expand All @@ -129,7 +137,9 @@ const bgColor = computed(() =>
);
onMounted(() => {
console.warn('v-nav-drawer is deprecated. Switch to new VNavDrawer component instead.');
console.warn(
'v-nav-drawer is deprecated. Switch to new VNavDrawer component instead.',
);
});
defineSlots<{
Expand All @@ -139,7 +149,7 @@ defineSlots<{
logo?: (props: {}) => any;
menus?: (props: {}) => any;
append?: (props: {}) => any;
}>()
}>();
</script>

<template>
Expand Down
2 changes: 1 addition & 1 deletion packages/select/src/VSelect.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import {computed, PropType, ref, toRefs, watch} from 'vue';
import {computed, type PropType, ref, toRefs, watch} from 'vue';
import {
Combobox,
ComboboxButton,
Expand Down
2 changes: 1 addition & 1 deletion packages/table/src/VDataTablePagination.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import {computed, PropType, ref, toRefs, watch} from 'vue';
import {computed, type PropType, ref, toRefs, watch} from 'vue';
import Pagination from '@morpheme/pagination';
type PaginationProps = InstanceType<typeof Pagination>['$props'];
Expand Down

0 comments on commit 32c1bd2

Please sign in to comment.