Repository navigation
perf: Optimize some style issues #7887
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,12 +81,12 @@ | |
| &:focus-visible { | ||
| outline: none !important; | ||
| } | ||
| &.is-link:focus { | ||
| background: none; | ||
| &.is-link { | ||
| border: none; | ||
| } | ||
| &.is-link:not(.is-disabled):hover { | ||
| color: var(--el-color-primary); | ||
| &:focus { | ||
| background: none; | ||
| border: none; | ||
| } | ||
| } | ||
| } | ||
| .el-button--text { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Code Review: SCSS Button Style ChangesSummary of ChangesThe diff refactors
Issues & Concerns🔴 1. Unintentional Removal of Hover Style (likely a bug)- &.is-link:not(.is-disabled):hover {
- color: var(--el-color-primary);
- }This hover rule is deleted with no replacement. If this was meant to be refactored rather than removed, link buttons will lose their primary-color hover feedback. This is likely an accidental deletion. Verify whether hover styling is now handled elsewhere; if not, restore it (e.g., nested under 🟡 2.
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,11 @@ | ||
| import {fileURLToPath, URL} from 'node:url' | ||
| import type {ProxyOptions} from 'vite' | ||
| import {defineConfig, loadEnv} from 'vite' | ||
| import { fileURLToPath, URL } from 'node:url' | ||
| import type { ProxyOptions } from 'vite' | ||
| import { defineConfig, loadEnv } from 'vite' | ||
| import vue from '@vitejs/plugin-vue' | ||
| import vueJsx from '@vitejs/plugin-vue-jsx' | ||
| import DefineOptions from 'unplugin-vue-define-options/vite' | ||
| import path from 'path' | ||
| import {createHtmlPlugin} from 'vite-plugin-html' | ||
| import { createHtmlPlugin } from 'vite-plugin-html' | ||
| import fs from 'fs' | ||
| // import vueDevTools from 'vite-plugin-vue-devtools' | ||
| const envDir = './env' | ||
|
|
@@ -36,15 +36,15 @@ export default defineConfig((conf: any) => { | |
| const ENV = loadEnv(mode, envDir) | ||
| const proxyConf: Record<string, string | ProxyOptions> = {} | ||
| proxyConf['/admin/api'] = { | ||
| target: 'http://127.0.0.1:8080', | ||
| target: 'https://mk-ee.fit2cloud.cn', | ||
| changeOrigin: true, | ||
| } | ||
| proxyConf['/chat/api'] = { | ||
| target: 'http://127.0.0.1:8080', | ||
| target: 'https://mk-ee.fit2cloud.cn', | ||
| changeOrigin: true, | ||
| } | ||
| proxyConf['/doc'] = { | ||
| target: 'http://127.0.0.1:8080', | ||
| target: 'https://mk-ee.fit2cloud.cn', | ||
| changeOrigin: true, | ||
| rewrite: (path: string) => path.replace(ENV.VITE_BASE_PATH, '/'), | ||
| } | ||
|
|
@@ -89,7 +89,7 @@ export default defineConfig((conf: any) => { | |
| vue(), | ||
| vueJsx(), | ||
| DefineOptions(), | ||
| createHtmlPlugin({template: ENV.VITE_ENTRY}), | ||
| createHtmlPlugin({ template: ENV.VITE_ENTRY }), | ||
| renameHtmlPlugin(`dist${ENV.VITE_BASE_PATH}`, ENV.VITE_ENTRY), | ||
| ], | ||
| server: { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here's my review of the diff: Issues & Concerns1. Hardcoded external proxy targets (
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are my findings:
Potential Issues
Return type inconsistency in
to_rulerule. Ifrulecould beundefinedor non-object,{ ...rule }spreads nothing. Consider guarding input type.computedreturn shape mismatch{ message, trigger, required }.to_rule(...)returning an object too — consistent. But note upstream consumers (rules.map(to_rule)returns an array) now differ:props_info.value.rulespresent → returns an arrayrulesprop which accepts array or single), this is fine for antd but fragile elsewhere. Safer to wrap fallback in[...].Order of conditions in
to_rulerequiredbranch executes after thevalidatorbranch. Sincevalidatorbranch returns early, that's correct. But the new branch overwrites any existingtype/whitespaceon the incoming rule without checking. Ifrule.typewas already set (e.g. string), it will be overwritten. Prefer merging only when unset:Missing null-check on
props.formfieldprops.formfield.input_typeassumesformfieldis defined. Elsewhere it's also accessed, so probably safe, but worth verifying.whitespace: truesemanticsPasswordInput, rejecting whitespace-only passwords may be intentional, but be aware some validators treat whitespace differently. Confirm product requirement — passwords with trailing spaces would now fail.TextareaInputwhitespacewhitespace: truewill reject purely-whitespace content. Usually desired for "required", but confirm UX.includeson possibly undefinedinput_type['...'].includes(undefined)returnsfalse, so safe. Fine.Recomputing
component_validatorreferenceOptimization / Style Suggestions
const WHITESPACE_CHECKED_INPUTS = [...]) to avoid recreating the array on everyto_rulecall.ruleafter resets nothing but keeps user intent separate from enforced defaults.PasswordInputwithrequired: truegets{ type: 'string', whitespace: true }and that a customvalidatorstill takes priority (it does, due to the early return).@@ -143,6 +143,12 @@header looks like a diff annotation pasted into source — verify it isn't accidentally committed into actual code.