feat: import type as type (#375)

This commit is contained in:
yuyang 2022-12-11 17:30:06 +08:00 committed by GitHub
parent 8f7276f7d7
commit 12a88c6d3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 20 additions and 15 deletions

View File

@ -55,7 +55,7 @@
</t-card> </t-card>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { PropType } from 'vue'; import type { PropType } from 'vue';
import { import {
ShopIcon, ShopIcon,
CalendarIcon, CalendarIcon,

View File

@ -9,7 +9,8 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { computed, ComputedRef } from 'vue'; import { computed } from 'vue';
import type { ComputedRef } from 'vue';
import { useTabsRouterStore } from '@/store'; import { useTabsRouterStore } from '@/store';
// <suspense>使 // <suspense>使

View File

@ -64,13 +64,14 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { PropType, computed } from 'vue'; import { computed } from 'vue';
import type { PropType } from 'vue';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { useSettingStore } from '@/store'; import { useSettingStore } from '@/store';
import { getActive } from '@/router'; import { getActive } from '@/router';
import { prefix } from '@/config/global'; import { prefix } from '@/config/global';
import LogoFull from '@/assets/assets-logo-full.svg?component'; import LogoFull from '@/assets/assets-logo-full.svg?component';
import { MenuRoute } from '@/types/interface'; import type { MenuRoute } from '@/types/interface';
import Notice from './Notice.vue'; import Notice from './Notice.vue';
import Search from './Search.vue'; import Search from './Search.vue';

View File

@ -21,7 +21,7 @@
:min-column-width="128" :min-column-width="128"
:popup-props="{ :popup-props="{
overlayClassName: 'route-tabs-dropdown', overlayClassName: 'route-tabs-dropdown',
onVisibleChange: (visible: boolean, ctx) => handleTabMenuClick(visible, ctx, routeItem.path), onVisibleChange: (visible, ctx) => handleTabMenuClick(visible, ctx, routeItem.path),
visible: activeTabPath === routeItem.path, visible: activeTabPath === routeItem.path,
}" }"
> >
@ -71,7 +71,7 @@ import { nextTick, ref, computed } from 'vue';
import { useRoute, useRouter } from 'vue-router'; import { useRoute, useRouter } from 'vue-router';
import { useSettingStore, useTabsRouterStore } from '@/store'; import { useSettingStore, useTabsRouterStore } from '@/store';
import { prefix } from '@/config/global'; import { prefix } from '@/config/global';
import { TRouterInfo } from '@/types/interface'; import type { TRouterInfo } from '@/types/interface';
import LContent from './Content.vue'; import LContent from './Content.vue';
import LBreadcrumb from './Breadcrumb.vue'; import LBreadcrumb from './Breadcrumb.vue';

View File

@ -29,9 +29,10 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { computed, PropType } from 'vue'; import { computed } from 'vue';
import type { PropType } from 'vue';
import isObject from 'lodash/isObject'; import isObject from 'lodash/isObject';
import { MenuRoute } from '@/types/interface'; import type { MenuRoute } from '@/types/interface';
import { getActive } from '@/router'; import { getActive } from '@/router';
const props = defineProps({ const props = defineProps({

View File

@ -49,7 +49,7 @@
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { storeToRefs } from 'pinia'; import { storeToRefs } from 'pinia';
import { useNotificationStore } from '@/store'; import { useNotificationStore } from '@/store';
import { NotificationItem } from '@/types/interface'; import type { NotificationItem } from '@/types/interface';
const router = useRouter(); const router = useRouter();
const store = useNotificationStore(); const store = useNotificationStore();

View File

@ -16,14 +16,15 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { computed, onMounted, PropType } from 'vue'; import { computed, onMounted } from 'vue';
import type { PropType } from 'vue';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import union from 'lodash/union'; import union from 'lodash/union';
import { useSettingStore } from '@/store'; import { useSettingStore } from '@/store';
import { prefix } from '@/config/global'; import { prefix } from '@/config/global';
import pgk from '../../../package.json'; import pgk from '../../../package.json';
import { MenuRoute } from '@/types/interface'; import type { MenuRoute } from '@/types/interface';
import { getActive, getRoutesExpanded } from '@/router'; import { getActive, getRoutesExpanded } from '@/router';
import AssetLogo from '@/assets/assets-t-logo.svg?component'; import AssetLogo from '@/assets/assets-t-logo.svg?component';

View File

@ -100,7 +100,8 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed, onMounted, watchEffect } from 'vue'; import { ref, computed, onMounted, watchEffect } from 'vue';
import { MessagePlugin, PopupVisibleChangeContext } from 'tdesign-vue-next'; import { MessagePlugin } from 'tdesign-vue-next';
import type { PopupVisibleChangeContext } from 'tdesign-vue-next';
import { Color } from 'tvision-color'; import { Color } from 'tvision-color';
import useClipboard from 'vue-clipboard3'; import useClipboard from 'vue-clipboard3';

View File

@ -60,7 +60,7 @@ export default {
import { ref, computed } from 'vue'; import { ref, computed } from 'vue';
import { storeToRefs } from 'pinia'; import { storeToRefs } from 'pinia';
import { NOTIFICATION_TYPES } from '@/constants'; import { NOTIFICATION_TYPES } from '@/constants';
import { NotificationItem } from '@/types/interface'; import type { NotificationItem } from '@/types/interface';
import EmptyIcon from '@/assets/assets-empty.svg?component'; import EmptyIcon from '@/assets/assets-empty.svg?component';
import { useNotificationStore } from '@/store'; import { useNotificationStore } from '@/store';

View File

@ -1,5 +1,5 @@
import { defineStore } from 'pinia'; import { defineStore } from 'pinia';
import { NotificationItem } from '@/types/interface'; import type { NotificationItem } from '@/types/interface';
const msgData = [ const msgData = [
{ {

View File

@ -1,5 +1,5 @@
import { defineStore } from 'pinia'; import { defineStore } from 'pinia';
import { TRouterInfo, TTabRouterType } from '@/types/interface'; import type { TRouterInfo, TTabRouterType } from '@/types/interface';
import { store } from '@/store'; import { store } from '@/store';
const homeRoute: Array<TRouterInfo> = [ const homeRoute: Array<TRouterInfo> = [