mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
refactor(hooks): 状态管理模块拆分
This commit is contained in:
@ -5,13 +5,14 @@
|
||||
<script lang="ts" setup>
|
||||
import { useLoadingBar, useDialog, useMessage, useNotification } from 'naive-ui';
|
||||
|
||||
function registerNaiveTool() {
|
||||
// 挂载naive组件的方法至window, 以便在路由钩子函数和请求函数里面调用
|
||||
function registerNaiveUiTools() {
|
||||
window.$loadingBar = useLoadingBar();
|
||||
window.$dialog = useDialog();
|
||||
window.$message = useMessage();
|
||||
window.$notification = useNotification();
|
||||
}
|
||||
|
||||
registerNaiveTool();
|
||||
registerNaiveUiTools();
|
||||
</script>
|
||||
<style scoped></style>
|
||||
|
@ -1,28 +0,0 @@
|
||||
<template>
|
||||
<div class="flex-center w-20px h-20px mx-6px mb-8px cursor-pointer rounded-2px" :style="{ backgroundColor: color }">
|
||||
<icon-ic-outline-check
|
||||
v-if="checked"
|
||||
class="text-14px text-white"
|
||||
:class="[isWhite ? 'text-gray-700' : 'text-white']"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
color: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
checked: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
});
|
||||
|
||||
const whiteColors = ['#ffffff', '#fff', 'rgb(255,255,255)'];
|
||||
const isWhite = computed(() => whiteColors.includes(props.color));
|
||||
</script>
|
||||
<style scoped></style>
|
@ -1,4 +1,3 @@
|
||||
import AppProviderContent from './AppProviderContent/index.vue';
|
||||
import ColorBlock from './ColorBlock/index.vue';
|
||||
|
||||
export { AppProviderContent, ColorBlock };
|
||||
export { AppProviderContent };
|
||||
|
@ -1 +1 @@
|
||||
export { AppProviderContent, ColorBlock } from './common';
|
||||
export { AppProviderContent } from './common';
|
||||
|
Reference in New Issue
Block a user