-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'template' into template-dev
- Loading branch information
Showing
23 changed files
with
275 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { PropType, Ref, Transition, TransitionProps, VNode } from 'vue'; | ||
import { MeKeepAliveProps, default as MeKeepAlive } from './meKeepAlive'; | ||
import { useLoadMessages } from '@/locales/i18n'; | ||
import { done } from '@/utils/nProgress'; | ||
import { localeConfig } from '@/config'; | ||
export default defineComponent({ | ||
props: { | ||
is: { | ||
type: [String, Object], | ||
}, | ||
keepAlive: Object as PropType<MeKeepAliveProps>, | ||
componentKey: [Number, String, Symbol], | ||
doneProgress: Boolean, | ||
transition: Object as PropType<TransitionProps>, | ||
}, | ||
setup(props, { attrs }) { | ||
const loadMessages = useLoadMessages(); | ||
const componentIs: Ref<any> = ref(undefined); | ||
const key = ref(props.componentKey); | ||
const _attrs = ref(attrs); | ||
watch( | ||
() => props.is, | ||
async (is) => { | ||
if (is) { | ||
localeConfig.loadMessageConfig.componentLoad && (await Promise.allSettled(loadMessages(is as any, false))); // 自动加载语言包 | ||
componentIs.value = is; | ||
key.value = props.componentKey; | ||
_attrs.value = attrs; | ||
if (props.doneProgress) { | ||
done(); | ||
} | ||
} | ||
}, | ||
{ immediate: true }, | ||
); | ||
|
||
return () => { | ||
const components = [] as VNode[]; | ||
components.push( | ||
h(componentIs.value || 'div', { | ||
key: key.value, | ||
..._attrs.value, | ||
}), | ||
); | ||
if (props.keepAlive) { | ||
const index = components.length - 1; | ||
components.push(h(MeKeepAlive, props.keepAlive, [components[index]])); | ||
} | ||
if (props.transition) { | ||
const index = components.length - 1; | ||
components.push(h(Transition, props.transition, { default: () => components[index] })); | ||
} | ||
return components[components.length - 1]; | ||
}; | ||
}, | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import '@/event/module'; | ||
import '@/styles/common.scss'; | ||
import '@/styles/index.scss'; | ||
import { bootscrapt } from './app'; | ||
bootscrapt(); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//自定义 element-ui 样式 | ||
.me-large { | ||
//这里强制将font-size-base设置为large | ||
--el-font-size-base: var(--el-font-size-large); | ||
} | ||
.me-small { | ||
//这里强制将font-size-base设置为small | ||
--el-font-size-base: var(--el-font-size-small); | ||
} | ||
//颜色选择器预定义样式加上border | ||
.el-color-predefine__color-selector > div { | ||
border: 1px solid var(--el-border-color); | ||
} | ||
.me-sidebar-drawer { | ||
.el-drawer__body { | ||
padding: 0; | ||
} | ||
} | ||
.el-breadcrumb { | ||
font-size: var(--el-font-size-base); | ||
} |
Oops, something went wrong.