diff --git a/.vscode/settings.json b/.vscode/settings.json index 7e2edd62..c3ab3c36 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -105,17 +105,12 @@ }, "stylelint.enable": true, "stylelint.packageManager": "yarn", - "css.validate": true, - "less.validate": true, - "scss.validate": true, // ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ // =========================================== // ================ Eslint =================== // =========================================== - // "eslint.enable": true, "eslint.alwaysShowStatus": true, "eslint.options": { - // 配置 "plugins": ["html", "vue", "javascript", "jsx", "typescript"], "extensions": [".js", ".jsx", ".ts", ".tsx", ".vue"] }, @@ -127,7 +122,6 @@ "html", "vue" ], - // "eslint.autoFixOnSave": true, // =========================================== // ================ Vetur ==================== // =========================================== @@ -139,7 +133,6 @@ "vetur.format.defaultFormatter.ts": "prettier-tslint", "vetur.format.defaultFormatter.js": "prettier", "vetur.languageFeatures.codeActions": false, - // "vetur.validation.script": false, "vetur.format.defaultFormatterOptions": { "js-beautify-html": { "wrap_attributes": "force-expand-multiline" @@ -201,6 +194,6 @@ "i18n-ally.namespace": true, "i18n-ally.pathMatcher": "{locale}/{namespaces}.{ext}", "i18n-ally.enabledParsers": ["ts"], - "i18n-ally.sourceLanguage": "zh", + "i18n-ally.sourceLanguage": "en", "i18n-ally.enabledFrameworks": ["vue", "react"] } diff --git a/CHANGELOG.zh_CN.md b/CHANGELOG.zh_CN.md index 1ffbe4f7..d2adb177 100644 --- a/CHANGELOG.zh_CN.md +++ b/CHANGELOG.zh_CN.md @@ -1,5 +1,9 @@ ## Wip +### ✨ Features + +- 图标选择器新增 svg 模式 + ### ✨ Refactor - 重构项目以解决循环依赖项导致的热更新问题 diff --git a/package.json b/package.json index 625da2e3..a09033f4 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "devDependencies": { "@commitlint/cli": "^12.0.1", "@commitlint/config-conventional": "^12.0.1", - "@iconify/json": "^1.1.313", + "@iconify/json": "^1.1.314", "@ls-lint/ls-lint": "^1.9.2", "@purge-icons/generated": "^0.7.0", "@types/crypto-js": "^4.0.1", @@ -110,7 +110,7 @@ "vite-plugin-purge-icons": "^0.7.0", "vite-plugin-pwa": "^0.5.6", "vite-plugin-style-import": "^0.8.1", - "vite-plugin-svg-icons": "^0.3.3", + "vite-plugin-svg-icons": "^0.3.4", "vite-plugin-theme": "^0.4.8", "vite-plugin-windicss": "0.7.1", "vue-eslint-parser": "^7.6.0", @@ -120,7 +120,7 @@ "//": "Used to install imagemin dependencies, because imagemin may not be installed in China.If it is abroad, you can delete it", "bin-wrapper": "npm:bin-wrapper-china", "esbuild": "0.8.57", - "rollup": "2.40.0" + "rollup": "2.41.0" }, "repository": { "type": "git", diff --git a/src/components/Application/src/search/AppSearch.vue b/src/components/Application/src/search/AppSearch.vue index 744de3c5..31c3ccc8 100644 --- a/src/components/Application/src/search/AppSearch.vue +++ b/src/components/Application/src/search/AppSearch.vue @@ -13,6 +13,7 @@ components: { AppSearchModal, Tooltip }, setup() { const showModal = ref(false); + const { getShowSearch } = useHeaderSetting(); const { t } = useI18n(); diff --git a/src/components/Application/src/search/AppSearchFooter.vue b/src/components/Application/src/search/AppSearchFooter.vue index 7db8839f..dfb5ffc2 100644 --- a/src/components/Application/src/search/AppSearchFooter.vue +++ b/src/components/Application/src/search/AppSearchFooter.vue @@ -14,14 +14,13 @@ diff --git a/src/components/Icon/src/IconPicker.vue b/src/components/Icon/src/IconPicker.vue index c0a836fc..4324ed0d 100644 --- a/src/components/Icon/src/IconPicker.vue +++ b/src/components/Icon/src/IconPicker.vue @@ -30,16 +30,17 @@
  • - + +
  • -
    +
    - + + + + + @@ -66,6 +71,7 @@ import { Input, Popover, Pagination, Empty } from 'ant-design-vue'; import Icon from './index.vue'; + import SvgIcon from './SvgIcon.vue'; import iconsData from '../data/icons.data'; import { propTypes } from '/@/utils/propTypes'; @@ -74,7 +80,7 @@ import { useI18n } from '/@/hooks/web/useI18n'; import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard'; import { useMessage } from '/@/hooks/web/useMessage'; - // import '@iconify/iconify'; + import svgIcons from 'vite-plugin-svg-icons/client'; function getIcons() { const data = iconsData as any; @@ -88,25 +94,35 @@ return result; } - const icons = getIcons(); + function getSvgIcons() { + return svgIcons.map((icon) => icon.replace('icon-', '')); + } + export default defineComponent({ name: 'IconPicker', - components: { [Input.name]: Input, Icon, Popover, ScrollContainer, Pagination, Empty }, + components: { [Input.name]: Input, Icon, Popover, ScrollContainer, Pagination, Empty, SvgIcon }, inheritAttrs: false, props: { value: propTypes.string, width: propTypes.string.def('100%'), pageSize: propTypes.number.def(140), copy: propTypes.bool.def(false), + mode: propTypes + .oneOf<('svg' | 'iconify')[]>(['svg', 'iconify']) + .def('iconify'), }, emits: ['change'], setup(props, { emit }) { + const isSvgMode = props.mode === 'svg'; + const icons = isSvgMode ? getSvgIcons() : getIcons(); + const currentSelect = ref(''); const visible = ref(false); const currentList = ref(icons); - const { prefixCls } = useDesign('icon-picker'); const { t } = useI18n(); + const { prefixCls } = useDesign('icon-picker'); + const [debounceHandleSearchChange] = useDebounce(handleSearchChange, 100); const { clipboardRef, isSuccessRef } = useCopyToClipboard(props.value); const { createMessage } = useMessage(); @@ -153,6 +169,7 @@ t, prefixCls, visible, + isSvgMode, getTotal, getPaginationList, handlePageChange, diff --git a/src/components/Tree/src/TreeHeader.vue b/src/components/Tree/src/TreeHeader.vue index 08d351ba..cc8d4969 100644 --- a/src/components/Tree/src/TreeHeader.vue +++ b/src/components/Tree/src/TreeHeader.vue @@ -24,7 +24,7 @@