From 4f43f1a001a680cec7bacbba98aa7dffaa012847 Mon Sep 17 00:00:00 2001 From: wangyifeng <812766448@qq.com> Date: Fri, 27 Dec 2024 16:57:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=90=9C=E7=B4=A2=E9=A1=B5=E9=9D=A2=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=90=9C=E7=B4=A2=E5=86=85=E5=AE=B9=E9=AB=98=E4=BA=AE?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=EF=BC=8C=E5=B9=B6=E5=A4=84=E7=90=86=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E6=95=B0=E6=8D=AE=E6=A0=BC=E5=BC=8F=EF=BC=8C=E6=8B=BC?= =?UTF-8?q?=E6=8E=A5=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- pnpm-lock.yaml | 62 +++---- src/pages/search/components/highLightText.vue | 70 ++++++++ src/pages/search/components/searchItem.vue | 163 +++++++++--------- src/pages/search/index.vue | 42 ++++- src/static/css/color.scss | 1 + src/uni_modules/tmui/locale/zh-Hans.json | 5 +- 7 files changed, 230 insertions(+), 115 deletions(-) create mode 100644 src/pages/search/components/highLightText.vue diff --git a/package.json b/package.json index ccf5355..fb66a73 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "quill-mention": "^6.0.2", "vconsole": "^3.15.1", "vue": "^3.3.8", - "vue-i18n": "^9.6.5" + "vue-i18n": "11.0.0-rc.1" }, "devDependencies": { "@dcloudio/types": "^3.4.7", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 26ae4d6..591bdda 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -93,8 +93,8 @@ importers: specifier: ^3.3.8 version: 3.4.35(typescript@5.5.4) vue-i18n: - specifier: ^9.6.5 - version: 9.13.1(vue@3.4.35(typescript@5.5.4)) + specifier: 11.0.0-rc.1 + version: 11.0.0-rc.1(vue@3.4.35(typescript@5.5.4)) devDependencies: '@dcloudio/types': specifier: ^3.4.7 @@ -1391,26 +1391,26 @@ packages: '@iconify/utils@2.1.32': resolution: {integrity: sha512-LeifFZPPKu28O3AEDpYJNdEbvS4/ojAPyIW+pF/vUpJTYnbTiXUHkCh0bwgFRzKvdpb8H4Fbfd/742++MF4fPQ==} + '@intlify/core-base@11.0.0-rc.1': + resolution: {integrity: sha512-fnfZoa9pb1dKM3L1UkDUGLLrPFQ2BK98x4/fMqwS/fktUor34vQR/itPtfv652ZTplenXXLCEYjUYTGfDZgMTQ==} + engines: {node: '>= 16'} + '@intlify/core-base@9.1.9': resolution: {integrity: sha512-x5T0p/Ja0S8hs5xs+ImKyYckVkL4CzcEXykVYYV6rcbXxJTe2o58IquSqX9bdncVKbRZP7GlBU1EcRaQEEJ+vw==} engines: {node: '>= 10'} - '@intlify/core-base@9.13.1': - resolution: {integrity: sha512-+bcQRkJO9pcX8d0gel9ZNfrzU22sZFSA0WVhfXrf5jdJOS24a+Bp8pozuS9sBI9Hk/tGz83pgKfmqcn/Ci7/8w==} - engines: {node: '>= 16'} - '@intlify/devtools-if@9.1.9': resolution: {integrity: sha512-oKSMKjttG3Ut/1UGEZjSdghuP3fwA15zpDPcjkf/1FjlOIm6uIBGMNS5jXzsZy593u+P/YcnrZD6cD3IVFz9vQ==} engines: {node: '>= 10'} + '@intlify/message-compiler@11.0.0-rc.1': + resolution: {integrity: sha512-TGw2uBfuTFTegZf/BHtUQBEKxl7Q/dVGLoqRIdw8lFsp9g/53sYn5iD+0HxIzdYjbWL6BTJMXCPUHp9PxDTRPw==} + engines: {node: '>= 16'} + '@intlify/message-compiler@9.1.9': resolution: {integrity: sha512-6YgCMF46Xd0IH2hMRLCssZI3gFG4aywidoWQ3QP4RGYQXQYYfFC54DxhSgfIPpVoPLQ+4AD29eoYmhiHZ+qLFQ==} engines: {node: '>= 10'} - '@intlify/message-compiler@9.13.1': - resolution: {integrity: sha512-SKsVa4ajYGBVm7sHMXd5qX70O2XXjm55zdZB3VeMFCvQyvLew/dLvq3MqnaIsTMF1VkkOb9Ttr6tHcMlyPDL9w==} - engines: {node: '>= 16'} - '@intlify/message-resolver@9.1.9': resolution: {integrity: sha512-Lx/DBpigeK0sz2BBbzv5mu9/dAlt98HxwbG7xLawC3O2xMF9MNWU5FtOziwYG6TDIjNq0O/3ZbOJAxwITIWXEA==} engines: {node: '>= 10'} @@ -1419,14 +1419,14 @@ packages: resolution: {integrity: sha512-XgPw8+UlHCiie3fI41HPVa/VDJb3/aSH7bLhY1hJvlvNV713PFtb4p4Jo+rlE0gAoMsMCGcsiT982fImolSltg==} engines: {node: '>= 10'} + '@intlify/shared@11.0.0-rc.1': + resolution: {integrity: sha512-8tR1xe7ZEbkabTuE/tNhzpolygUn9OaYp9yuYAF4MgDNZg06C3Qny80bes2/e9/Wm3aVkPUlCw6WgU7mQd0yEg==} + engines: {node: '>= 16'} + '@intlify/shared@9.1.9': resolution: {integrity: sha512-xKGM1d0EAxdDFCWedcYXOm6V5Pfw/TMudd6/qCdEb4tv0hk9EKeg7lwQF1azE0dP2phvx0yXxrt7UQK+IZjNdw==} engines: {node: '>= 10'} - '@intlify/shared@9.13.1': - resolution: {integrity: sha512-u3b6BKGhE6j/JeRU6C/RL2FgyJfy6LakbtfeVF8fJXURpZZTzfh3e05J0bu0XPw447Q6/WUp3C4ajv4TMS4YsQ==} - engines: {node: '>= 16'} - '@intlify/vue-devtools@9.1.9': resolution: {integrity: sha512-YPehH9uL4vZcGXky4Ev5qQIITnHKIvsD2GKGXgqf+05osMUI6WSEQHaN9USRa318Rs8RyyPCiDfmA0hRu3k7og==} engines: {node: '>= 10'} @@ -4819,8 +4819,8 @@ packages: '@vue/composition-api': optional: true - vue-i18n@9.13.1: - resolution: {integrity: sha512-mh0GIxx0wPtPlcB1q4k277y0iKgo25xmDPWioVVYanjPufDBpvu5ySTjP5wOrSvlYQ2m1xI+CFhGdauv/61uQg==} + vue-i18n@11.0.0-rc.1: + resolution: {integrity: sha512-qbdCbA537HEdr2yXQ4ec/OMDsoHjod1DwnWbrf+l4Cu/O7CYTCKsOyITUm3RmrCJgRnoVycuR6i/JWdNTJvD5g==} engines: {node: '>= 16'} peerDependencies: vue: ^3.0.0 @@ -6730,6 +6730,11 @@ snapshots: transitivePeerDependencies: - supports-color + '@intlify/core-base@11.0.0-rc.1': + dependencies: + '@intlify/message-compiler': 11.0.0-rc.1 + '@intlify/shared': 11.0.0-rc.1 + '@intlify/core-base@9.1.9': dependencies: '@intlify/devtools-if': 9.1.9 @@ -6739,26 +6744,21 @@ snapshots: '@intlify/shared': 9.1.9 '@intlify/vue-devtools': 9.1.9 - '@intlify/core-base@9.13.1': - dependencies: - '@intlify/message-compiler': 9.13.1 - '@intlify/shared': 9.13.1 - '@intlify/devtools-if@9.1.9': dependencies: '@intlify/shared': 9.1.9 + '@intlify/message-compiler@11.0.0-rc.1': + dependencies: + '@intlify/shared': 11.0.0-rc.1 + source-map-js: 1.2.0 + '@intlify/message-compiler@9.1.9': dependencies: '@intlify/message-resolver': 9.1.9 '@intlify/shared': 9.1.9 source-map: 0.6.1 - '@intlify/message-compiler@9.13.1': - dependencies: - '@intlify/shared': 9.13.1 - source-map-js: 1.2.0 - '@intlify/message-resolver@9.1.9': {} '@intlify/runtime@9.1.9': @@ -6767,9 +6767,9 @@ snapshots: '@intlify/message-resolver': 9.1.9 '@intlify/shared': 9.1.9 - '@intlify/shared@9.1.9': {} + '@intlify/shared@11.0.0-rc.1': {} - '@intlify/shared@9.13.1': {} + '@intlify/shared@9.1.9': {} '@intlify/vue-devtools@9.1.9': dependencies: @@ -10890,10 +10890,10 @@ snapshots: dependencies: vue: 3.4.35(typescript@5.5.4) - vue-i18n@9.13.1(vue@3.4.35(typescript@5.5.4)): + vue-i18n@11.0.0-rc.1(vue@3.4.35(typescript@5.5.4)): dependencies: - '@intlify/core-base': 9.13.1 - '@intlify/shared': 9.13.1 + '@intlify/core-base': 11.0.0-rc.1 + '@intlify/shared': 11.0.0-rc.1 '@vue/devtools-api': 6.6.3 vue: 3.4.35(typescript@5.5.4) diff --git a/src/pages/search/components/highLightText.vue b/src/pages/search/components/highLightText.vue new file mode 100644 index 0000000..2839885 --- /dev/null +++ b/src/pages/search/components/highLightText.vue @@ -0,0 +1,70 @@ + + + + + {{ part.text }} + + {{ part.text }} + + + + + + + diff --git a/src/pages/search/components/searchItem.vue b/src/pages/search/components/searchItem.vue index 62807dd..883800f 100644 --- a/src/pages/search/components/searchItem.vue +++ b/src/pages/search/components/searchItem.vue @@ -5,17 +5,21 @@