chore: 升级 layer-vue 1.3.10

This commit is contained in:
就眠儀式 2022-03-14 13:13:31 +08:00
parent e572539ead
commit e6b7338d37
4 changed files with 15 additions and 15 deletions

View File

@ -10,31 +10,31 @@ import "@docsearch/css";
onMounted(() => { onMounted(() => {
docsearch({ docsearch({
container: "#docsearch",
appId: "BIYZTK0F0Q", appId: "BIYZTK0F0Q",
apiKey: "4b228ca4dcda0f1d5d9ff9938c2b4f59", apiKey: "de599990b844bc1b325310f61ad19a78",
indexName: "layui-vue" indexName: "layui-vue",
container: "#docsearch",
debug: false,
}); });
}); });
</script> </script>
<style> <style>
.DocSearch-Button { .DocSearch-Button {
outline: none; outline: none;
box-shadow: none; box-shadow: none;
} }
.DocSearch-Button .DocSearch-Search-Icon, .DocSearch-Button .DocSearch-Search-Icon,
.DocSearch-Button-Placeholder { .DocSearch-Button-Placeholder {
color: whitesmoke; color: whitesmoke;
} }
:root { :root {
--docsearch-logo-color: var(--global-primary-color); --docsearch-logo-color: var(--global-primary-color);
--docsearch-primary-color: var(--global-primary-color) ; --docsearch-primary-color: var(--global-primary-color);
--docsearch-searchbox-background: rgba(255, 255, 255, 0.05); --docsearch-searchbox-background: rgba(255, 255, 255, 0.05);
--docsearch-searchbox-focus-background: rgba(255, 255, 255, 0.05); --docsearch-searchbox-focus-background: rgba(255, 255, 255, 0.05);
--docsearch-container-background: rgba(0, 0, 0, 0.1);; --docsearch-container-background: rgba(0, 0, 0, 0.1);
} }
</style> </style>

View File

@ -38,7 +38,7 @@
"dependencies": { "dependencies": {
"@docsearch/js": "3.0.0", "@docsearch/js": "3.0.0",
"@layui/icons-vue": "^1.0.7", "@layui/icons-vue": "^1.0.7",
"@layui/layer-vue": "^1.3.8", "@layui/layer-vue": "^1.3.10",
"@vueuse/core": "^7.6.2", "@vueuse/core": "^7.6.2",
"async-validator": "^4.0.7", "async-validator": "^4.0.7",
"evtd": "^0.2.3", "evtd": "^0.2.3",

View File

@ -240,3 +240,5 @@ export {
export { layer }; export { layer };
export default { install }; export default { install };
export * from "./resolver";

View File

@ -1,11 +1,10 @@
/** /**
* Layui Vue Resolver * Layui-vue Resolver
*
* On-demand import components for @layui/layui-vue * On-demand import components for @layui/layui-vue
* component and style resolver for @layui/icons-vue * component and style resolver for @layui/icons-vue
* layer API * layer API
* TODO On-demand import style
*/ */
// TODO 待 css 完善,以下除特殊注释的外, styleDir: '' 为未拆分的
const matchComponents = [ const matchComponents = [
{ {
pattern: /^LayAvatarList$/, pattern: /^LayAvatarList$/,
@ -112,6 +111,7 @@ const matchComponents = [
]; ];
export interface LayuiVueResolverOptions { export interface LayuiVueResolverOptions {
/** /**
* import style along with components * import style along with components
* *
@ -133,6 +133,7 @@ export interface LayuiVueResolverOptions {
* *
*/ */
exclude?: string[]; exclude?: string[];
} }
const libRE = /^Lay[A-Z]/; const libRE = /^Lay[A-Z]/;
@ -147,7 +148,6 @@ function lowerCamelCase(str: string) {
function getSideEffects(importName: string, options: LayuiVueResolverOptions) { function getSideEffects(importName: string, options: LayuiVueResolverOptions) {
const { importStyle = true } = options; const { importStyle = true } = options;
if (!importStyle) return; if (!importStyle) return;
let styleDir: string | undefined = undefined; let styleDir: string | undefined = undefined;
if (importName.match(iconsRE)) { if (importName.match(iconsRE)) {
return `@layui/icons-vue/lib/index.css`; return `@layui/icons-vue/lib/index.css`;
@ -161,8 +161,6 @@ function getSideEffects(importName: string, options: LayuiVueResolverOptions) {
break; break;
} }
} }
// FIXME 临时方案,部分组件样式未拆分
// return styleDir ? `${esComponentsFolder}/${styleDir}/index.css` : `@layui/layui-vue/lib/index.css`
return styleDir ? `${esComponentsFolder}/${styleDir}/index.css` : undefined; return styleDir ? `${esComponentsFolder}/${styleDir}/index.css` : undefined;
} }
} }
@ -191,7 +189,7 @@ function resolveComponent(name: string, options: LayuiVueResolverOptions) {
/** /**
* Resolver for layui-vue * Resolver for layui-vue
* Requires @layui/layui-vue@v0.3.X() or later *
* @param options * @param options
* @returns * @returns
*/ */