feat(projects): 添加naiveUI按需引入

This commit is contained in:
Soybean
2022-02-17 00:58:55 +08:00
parent 225e7128b6
commit a810ef85b1
69 changed files with 231 additions and 120 deletions

View File

@ -9,7 +9,6 @@
</template>
<script setup lang="ts">
import { NCard, NDescriptions, NDescriptionsItem } from 'naive-ui';
import { pkgJson } from '../model';
const { devDependencies } = pkgJson;

View File

@ -9,7 +9,6 @@
</template>
<script setup lang="ts">
import { NCard, NDescriptions, NDescriptionsItem } from 'naive-ui';
import { pkgJson } from '../model';
const { dependencies } = pkgJson;

View File

@ -18,7 +18,6 @@
</template>
<script setup lang="ts">
import { NCard, NDescriptions, NDescriptionsItem, NTag } from 'naive-ui';
import { pkgJson } from '../model';
const { version } = pkgJson;

View File

@ -7,7 +7,5 @@
</n-card>
</template>
<script setup lang="ts">
import { NCard } from 'naive-ui';
</script>
<script setup lang="ts"></script>
<style scoped></style>

View File

@ -8,7 +8,6 @@
</template>
<script setup lang="ts">
import { NSpace } from 'naive-ui';
import { ProjectIntroduction, ProjectInfo, ProDependency, DevDependency } from './components';
</script>
<style scoped></style>

View File

@ -35,7 +35,6 @@
</template>
<script setup lang="ts">
import { NCard, NGrid, NGridItem, NSpace, NButton } from 'naive-ui';
import type { ButtonProps } from 'naive-ui';
import { Icon } from '@iconify/vue';
import { useLoading } from '@/hooks';

View File

@ -37,7 +37,5 @@
</div>
</template>
<script setup lang="ts">
import { NCard, NSpace } from 'naive-ui';
</script>
<script setup lang="ts"></script>
<style scoped></style>

View File

@ -16,7 +16,6 @@
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import { NCard, NSpace, NButton, NDataTable } from 'naive-ui';
import type { DataTableColumn } from 'naive-ui';
import { LoadingEmptyWrapper } from '@/components';
import { useLoadingEmpty } from '@/hooks';

View File

@ -21,7 +21,7 @@
<script setup lang="ts">
import { h } from 'vue';
import { NGrid, NGridItem, NCard, NTimeline, NTimelineItem, NDataTable, NTag } from 'naive-ui';
import { NTag } from 'naive-ui';
interface TimelineData {
type: 'default' | 'info' | 'success' | 'warning' | 'error';

View File

@ -18,7 +18,6 @@
</template>
<script setup lang="ts">
import { NGrid, NGridItem } from 'naive-ui';
import { Icon } from '@iconify/vue';
import { CountTo } from '@/components';
import { GradientBg } from './components';

View File

@ -32,7 +32,6 @@
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import { NGrid, NGridItem, NCard, NButton } from 'naive-ui';
import { Line, Pie } from '@antv/g2plot';
import { CountTo } from '@/components';
import data from './data.json';

View File

@ -7,7 +7,6 @@
</template>
<script lang="ts" setup>
import { NSpace } from 'naive-ui';
import { TopChart, DataCard, BottomPart } from './components';
</script>
<style scoped></style>

View File

@ -16,7 +16,6 @@
</template>
<script setup lang="ts">
import { NCard, NSpace, NStatistic } from 'naive-ui';
import { useAuthStore } from '@/store';
interface StatisticData {

View File

@ -47,7 +47,6 @@
</template>
<script setup lang="ts">
import { NGrid, NGridItem, NSpace, NCard, NList, NListItem, NThing } from 'naive-ui';
import { SvgBanner } from '@/components';
import { TechnologyCard, ShortcutsCard } from './components';

View File

@ -5,7 +5,6 @@
</n-space>
</template>
<script lang="ts" setup>
import { NSpace } from 'naive-ui';
import { WorkbenchHeader, WorkbenchMain } from './components';
</script>
<style scoped></style>

View File

@ -4,7 +4,5 @@
</div>
</template>
<script setup lang="ts">
import { NCard } from 'naive-ui';
</script>
<script setup lang="ts"></script>
<style scoped></style>

View File

@ -4,7 +4,5 @@
</div>
</template>
<script setup lang="ts">
import { NCard } from 'naive-ui';
</script>
<script setup lang="ts"></script>
<style scoped></style>

View File

@ -11,24 +11,22 @@
<script lang="ts" setup>
import { ref } from 'vue';
import { NCard, NInputGroup, NInput, NButton, useMessage } from 'naive-ui';
import { useClipboard } from '@vueuse/core';
const source = ref('');
const message = useMessage();
const { copy, isSupported } = useClipboard();
function handleCopy() {
if (!isSupported) {
message.error('您的浏览器不支持Clipboard API');
window.$message?.error('您的浏览器不支持Clipboard API');
return;
}
if (!source.value) {
message.error('请输入要复制的内容');
window.$message?.error('请输入要复制的内容');
return;
}
copy(source.value);
message.success(`复制成功:${source.value}`);
window.$message?.success(`复制成功:${source.value}`);
}
</script>
<style scoped></style>

View File

@ -11,7 +11,6 @@
<script setup lang="ts">
import { ref, watch, onMounted, onUnmounted } from 'vue';
import { NCard } from 'naive-ui';
import Vditor from 'vditor';
import 'vditor/src/assets/scss/index.scss';
import { GithubLink } from '@/components';

View File

@ -11,7 +11,6 @@
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import { NCard } from 'naive-ui';
import WangEditor from 'wangeditor';
import { GithubLink } from '@/components';

View File

@ -21,7 +21,6 @@
<script lang="ts" setup>
import { ref } from 'vue';
import { NCard } from 'naive-ui';
import { Icon } from '@iconify/vue';
import { IconSelect, WebSiteLink } from '@/components';
import { icons } from './icons';

View File

@ -12,7 +12,6 @@
<script setup lang="ts">
import type { Component } from 'vue';
import { NCard, NTabs, NTabPane } from 'naive-ui';
import { GaodeMap, TencentMap } from './components';
interface Map {

View File

@ -11,7 +11,6 @@
</template>
<script lang="ts" setup>
import { NCard, NButton } from 'naive-ui';
import printJS from 'print-js';
import { GithubLink } from '@/components';

View File

@ -21,7 +21,6 @@
</template>
<script setup lang="ts">
import { NCard, NSpace } from 'naive-ui';
import SwiperCore, { Navigation, Pagination } from 'swiper';
import { Swiper, SwiperSlide } from 'swiper/vue';
import type { SwiperOptions } from 'swiper';

View File

@ -8,7 +8,6 @@
<script setup lang="ts">
import { ref, onMounted, onUnmounted } from 'vue';
import { NCard } from 'naive-ui';
import Player from 'xgplayer';
const domRef = ref<HTMLElement>();

View File

@ -12,7 +12,6 @@
<script lang="ts" setup>
import { computed } from 'vue';
import type { Component } from 'vue';
import { NButton } from 'naive-ui';
import { SvgNoPermission, SvgNotFound, SvgServiceError } from '@/components';
import { routeName } from '@/router';

View File

@ -21,7 +21,6 @@
<script setup lang="ts">
import { reactive, ref } from 'vue';
import { NForm, NFormItem, NInput, NSpace, NButton } from 'naive-ui';
import type { FormInst } from 'naive-ui';
import { useRouterPush } from '@/composables';
import { useSmsCode } from '@/hooks';

View File

@ -36,7 +36,6 @@
<script setup lang="ts">
import { reactive, ref } from 'vue';
import { NForm, NFormItem, NInput, NSpace, NButton } from 'naive-ui';
import type { FormInst } from 'naive-ui';
import { ImageVerify } from '@/components';
import { useAuthStore } from '@/store';

View File

@ -9,7 +9,5 @@
</n-space>
</template>
<script lang="ts" setup>
import { NSpace, NDivider, NButton } from 'naive-ui';
</script>
<script lang="ts" setup></script>
<style scoped></style>

View File

@ -37,7 +37,6 @@
<script setup lang="ts">
import { reactive, ref } from 'vue';
import { NForm, NFormItem, NInput, NSpace, NCheckbox, NButton } from 'naive-ui';
import type { FormInst, FormRules } from 'naive-ui';
import { EnumLoginModule } from '@/enum';
import { useAuthStore } from '@/store';

View File

@ -28,7 +28,6 @@
<script lang="ts" setup>
import { reactive, ref, toRefs } from 'vue';
import { NForm, NFormItem, NInput, NSpace, NButton } from 'naive-ui';
import type { FormInst, FormRules } from 'naive-ui';
import { LoginAgreement } from '@/components';
import { useRouterPush } from '@/composables';

View File

@ -27,13 +27,11 @@
<script lang="ts" setup>
import { reactive, ref, toRefs } from 'vue';
import { NForm, NFormItem, NInput, NSpace, NButton, useMessage } from 'naive-ui';
import type { FormInst, FormRules } from 'naive-ui';
import { useRouterPush } from '@/composables';
import { useSmsCode } from '@/hooks';
import { formRules, getConfirmPwdRule } from '@/utils';
const message = useMessage();
const { toLoginModule } = useRouterPush();
const { label, isCounting, loading: smsLoading, start } = useSmsCode();
@ -61,9 +59,9 @@ function handleSubmit(e: MouseEvent) {
formRef.value.validate(errors => {
if (!errors) {
message.success('验证成功');
window.$message?.success('验证成功');
} else {
message.error('验证失败');
window.$message?.error('验证失败');
}
});
}

View File

@ -30,7 +30,6 @@
<script setup lang="ts">
import { computed } from 'vue';
import type { Component } from 'vue';
import { NCard, NGradientText } from 'naive-ui';
import { EnumLoginModule } from '@/enum';
import { SystemLogo, DarkModeSwitch } from '@/components';
import { useThemeStore } from '@/store';