This repository has been archived on 2023-08-30. You can view files and clone it, but cannot push or open issues/pull-requests.
bytedo
/
wcui
Archived
1
0
Fork 0

优化分页组件样式;优化dropdown组件

old
宇天 2021-04-09 19:18:55 +08:00
parent def0211e95
commit 7921b0fe24
3 changed files with 25 additions and 12 deletions

View File

@ -2,7 +2,7 @@
<div class="label"> <div class="label">
<section class="preview"> <section class="preview">
<input readonly /> <input readonly />
<wc-icon is="left"></wc-icon> <wc-icon is="trigon-down"></wc-icon>
</section> </section>
<ul class="options-box"></ul> <ul class="options-box"></ul>
<slot name="option"></slot> <slot name="option"></slot>
@ -66,8 +66,8 @@ slot {
} }
} }
wc-icon { wc-icon {
--size: 16px; --size: 14px;
transform: rotate(-90deg); color: var(--color-grey-2);
} }
} }
@ -79,6 +79,7 @@ slot {
position: absolute; position: absolute;
left: 0; left: 0;
top: 36px; top: 36px;
z-index: 99;
width: 100%; width: 100%;
height: 0; height: 0;
border-radius: 3px; border-radius: 3px;

View File

@ -88,6 +88,8 @@ const SVG_PATH = {
'M475.2 251.1c0-10.3 3.6-19.1 10.7-26.4 7.1-7.3 16.2-11 27-11 10.4 0 19.1 3.7 26.3 11 7.1 7.3 10.7 16.1 10.7 26.4 0 10.3-3.6 19.1-10.7 26.4-7.2 7.3-15.9 11-26.3 11-10.9 0-19.9-3.7-27-11-7.1-7.4-10.7-16.2-10.7-26.4z m66.7 526.4c0 22.2-9.2 33.4-27.7 33.4-18.9 0-28.4-11.1-28.4-33.4V397.2c0-12.8 2.7-21.8 8-27.1 5.3-5.3 12.1-7.9 20.4-7.9 8.2 0 14.9 2.5 20 7.5s7.6 14.2 7.6 27.5v380.3zM512 120c216.5 0 392 175.5 392 392 0 78.5-23.1 151.5-62.8 212.8-0.6 12.9 6.4 24.8 17.8 30.2 10 4.7 22 3.6 31.3-2.9C934.4 682.7 960 600.3 960 512c0-247.4-200.6-448-448-448S64 264.6 64 512s200.6 448 448 448c83.3 0 161.3-22.7 228.1-62.4 9.5-9.6 11.4-24.3 4.9-35.6-6-10.5-18.1-16.2-30.3-14.4C655.5 883.4 586.2 904 512 904c-216.5 0-392-175.5-392-392s175.5-392 392-392z', 'M475.2 251.1c0-10.3 3.6-19.1 10.7-26.4 7.1-7.3 16.2-11 27-11 10.4 0 19.1 3.7 26.3 11 7.1 7.3 10.7 16.1 10.7 26.4 0 10.3-3.6 19.1-10.7 26.4-7.2 7.3-15.9 11-26.3 11-10.9 0-19.9-3.7-27-11-7.1-7.4-10.7-16.2-10.7-26.4z m66.7 526.4c0 22.2-9.2 33.4-27.7 33.4-18.9 0-28.4-11.1-28.4-33.4V397.2c0-12.8 2.7-21.8 8-27.1 5.3-5.3 12.1-7.9 20.4-7.9 8.2 0 14.9 2.5 20 7.5s7.6 14.2 7.6 27.5v380.3zM512 120c216.5 0 392 175.5 392 392 0 78.5-23.1 151.5-62.8 212.8-0.6 12.9 6.4 24.8 17.8 30.2 10 4.7 22 3.6 31.3-2.9C934.4 682.7 960 600.3 960 512c0-247.4-200.6-448-448-448S64 264.6 64 512s200.6 448 448 448c83.3 0 161.3-22.7 228.1-62.4 9.5-9.6 11.4-24.3 4.9-35.6-6-10.5-18.1-16.2-30.3-14.4C655.5 883.4 586.2 904 512 904c-216.5 0-392-175.5-392-392s175.5-392 392-392z',
key: key:
'M497.4 443.1C466.8 356.5 378.7 288 281.5 288 158.3 288 64 388.8 64 512s98.6 224 221.8 224c97.1 0 181.1-68.5 211.5-155.1h221.4v137.8h148.8V580.9H960V443.1H497.4zM287.9 608.9c-52.9 0-96.1-43.2-96.1-96.1s43.2-96.1 96.1-96.1 96.1 43.2 96.1 96.1-43.2 96.1-96.1 96.1z', 'M497.4 443.1C466.8 356.5 378.7 288 281.5 288 158.3 288 64 388.8 64 512s98.6 224 221.8 224c97.1 0 181.1-68.5 211.5-155.1h221.4v137.8h148.8V580.9H960V443.1H497.4zM287.9 608.9c-52.9 0-96.1-43.2-96.1-96.1s43.2-96.1 96.1-96.1 96.1 43.2 96.1 96.1-43.2 96.1-96.1 96.1z',
layout:
'M909.9 851.2H114.1c-27.6 0-50.1-22.3-50.1-49.8V222.6c0-27.4 22.5-49.8 50.1-49.8h795.7c27.6 0 50.1 22.3 50.1 49.8v578.9c0.1 27.4-22.4 49.7-50 49.7zM384 783.5h256v-544H384v544z m-253.4-544c-1.4 0-2.6 1.2-2.6 2.6v538.4c0 1.4 1.3 2.6 2.6 2.6 63.1 0.1 126.2 0.3 189.4 0.4V240.4l-189.4-0.9z m573.4 0.9v543.1c63.1-0.1 126.2-0.3 189.4-0.4 1.4 0 2.6-1.2 2.6-2.6V242.1c0-1.4-1.3-2.6-2.6-2.6l-189.4 0.9z',
left: left:
'M710.9 948.6L251 539.7l-0.3-0.3c-7.7-7.4-12-17.2-12-27.6 0-12.4 6.1-23.9 16.8-31.6L710.9 75.3C719.1 68 730 64 741.5 64c24.2 0 43.9 18.1 43.9 40.3 0 11.1-4.8 21.4-13.4 29L345.8 512 772 890.8c8.5 7.6 13.4 18.1 13.4 29 0 22.2-19.7 40.3-43.9 40.3-11.4-0.1-22.2-4.1-30.6-11.5z', 'M710.9 948.6L251 539.7l-0.3-0.3c-7.7-7.4-12-17.2-12-27.6 0-12.4 6.1-23.9 16.8-31.6L710.9 75.3C719.1 68 730 64 741.5 64c24.2 0 43.9 18.1 43.9 40.3 0 11.1-4.8 21.4-13.4 29L345.8 512 772 890.8c8.5 7.6 13.4 18.1 13.4 29 0 22.2-19.7 40.3-43.9 40.3-11.4-0.1-22.2-4.1-30.6-11.5z',
linux: linux:
@ -173,6 +175,10 @@ const SVG_PATH = {
'M738.3 425.3c1.2 1.1 2.5 2.2 3.9 3.2 24.5 18 63.2 8.4 92.1-22.8 30.4-32.7 35.7-75.4 12.3-97.2-24.1-21.9-65.5-13.3-96 19.6-13.2 14.2-22.3 31.1-25.6 47.5-4.1 19.9 0.7 38.1 13.3 49.7z m44.5-67.3c15.6-16.8 31.2-18.9 33.7-17.3 1.9 2.5 1 18.2-14.6 35-15.5 16.8-31.1 18.9-33.8 17.3-1.7-2.6-0.7-18.3 14.7-35z m34.4 158.2c2.1 2.4 4.4 4.6 7 6.5 19.7 14.4 49.6 10.6 72.8-9.2 26.5-22.7 33.1-57.2 15-78.4-17.8-20.8-53.5-19.7-79.7 2.7-26.7 22.7-33.3 57.2-15.1 78.4z m42.6-46c9.1-7.8 18-8.3 19.5-7.6 0.8 2-1.1 10.8-10.1 18.5-8.7 7.4-17.2 8.2-19.6 7.3-0.5-2.5 1.6-10.8 10.2-18.2z m79 110.6c-5.4-24-35.6-38.8-65.5-32-31.1 7-51.1 32.1-45.5 57 2.1 9.3 7.6 17.5 15.8 23.5 12.9 9.5 31.5 12.7 49.8 8.5 13.5-3.1 25.7-9.8 34.1-19.1 10.1-11 14.3-24.8 11.3-37.9z m-54.3 17.8c-7.7 1.7-14.3 0.3-17.1-1.7 1-2.3 5.7-6.9 14.7-9 7.8-1.7 14.3-0.3 17.5 1.1-0.4 1.9-5.2 7.4-15.1 9.6zM731.3 464.8l-139.6-151-3-2.8c-38.7-31-87.9-42.5-133.7-32.3-40.1 8.9-73.1 33.7-90.6 68-18.8 36.8-18.3 84.2-17.8 130.1 0.5 50.2 1.1 102.1-24.7 130.4-26 28.6-54 35.8-86.3 44.1-34.7 8.9-74 19-111.5 56.6-28.7 28.8-43.1 67.4-39.3 105.9 3 30.7 19.2 76.5 79.3 119.8l0.7 0.5c73 52.2 175.5 14.7 221.1-19.4 0.7-0.4 1.2-1 1.8-1.4 1.5-1.2 3.2-2.4 4.6-3.5l-0.2-0.3c0.6-0.7 1.4-1 2-1.7 8.6-11.3 5.8-27.5-6.1-36-9.9-7.1-22.8-6.3-31.8 0.5l-0.3-0.3c-59 34.1-114.1 55.2-161.1 21.6-35.2-25.4-55.2-54.2-58.1-83.4-2.3-24.1 6.9-48.5 25.4-67 27.8-27.8 55.7-35 88.1-43.3 35.2-9.1 75.2-19.3 111.3-59.1 38.5-42.4 37.9-103.9 37.2-163.4-0.5-41.9-0.9-81.4 12.5-107.7 10.8-21.1 31.4-36.5 56.6-42.1 28.2-6.3 58.7 0.3 83.6 18.2 1.1 0.8 2.3 1.6 3.4 2.5L692.3 497c49.3 57.6 48.2 110.2-3.4 165.6-61.9 65.9-124.7 96.7-180.2 123l0.1 0.2c-3.4 1.7-6.5 4-9 7.2-8.6 11.3-5.8 27.5 6.1 36 8.4 6 19.1 6.4 27.8 2.2l0.1 0.2c55.7-26.5 128.7-65.1 194-134.6 68.9-74 70.4-154 3.5-232zM524.1 242.4c4.1 3 8.6 5.4 13.3 7.2 37.4 13.9 81.5-15.2 100.5-66.3 16.2-43.6 8.2-88.3-19.6-108.7-4.1-3-8.6-5.4-13.3-7.2-18.8-7-40.8-3-60.1 11-17.5 12.6-31.8 32.2-40.4 55.3-16.2 43.6-8.2 88.3 19.6 108.7z m16.7-93.1c5.5-14.8 14.7-27.7 25.2-35.3 5-3.6 14.8-9.2 23.9-5.8 1.4 0.5 2.8 1.3 4 2.2 11.2 8.2 16.6 33.3 6.3 61-11.4 30.7-35.1 46.3-49.1 41.1-1.4-0.5-2.8-1.3-4-2.2-11.1-8.2-16.6-33.3-6.3-61z m104.8 181.2c27.5 20.4 71.3 5.7 99.7-33.5 28.4-39.2 29.1-85.8 1.6-106.2-27.5-20.4-71.3-5.7-99.7 33.5-28.4 39.1-29.1 85.8-1.6 106.2z m74.8-103.1c3.4 2.5 4.9 21.2-10.9 43s-33.9 26-37.3 23.5c-3.4-2.5-4.9-21.2 11-43.1 15.7-21.8 33.8-26 37.2-23.4z', 'M738.3 425.3c1.2 1.1 2.5 2.2 3.9 3.2 24.5 18 63.2 8.4 92.1-22.8 30.4-32.7 35.7-75.4 12.3-97.2-24.1-21.9-65.5-13.3-96 19.6-13.2 14.2-22.3 31.1-25.6 47.5-4.1 19.9 0.7 38.1 13.3 49.7z m44.5-67.3c15.6-16.8 31.2-18.9 33.7-17.3 1.9 2.5 1 18.2-14.6 35-15.5 16.8-31.1 18.9-33.8 17.3-1.7-2.6-0.7-18.3 14.7-35z m34.4 158.2c2.1 2.4 4.4 4.6 7 6.5 19.7 14.4 49.6 10.6 72.8-9.2 26.5-22.7 33.1-57.2 15-78.4-17.8-20.8-53.5-19.7-79.7 2.7-26.7 22.7-33.3 57.2-15.1 78.4z m42.6-46c9.1-7.8 18-8.3 19.5-7.6 0.8 2-1.1 10.8-10.1 18.5-8.7 7.4-17.2 8.2-19.6 7.3-0.5-2.5 1.6-10.8 10.2-18.2z m79 110.6c-5.4-24-35.6-38.8-65.5-32-31.1 7-51.1 32.1-45.5 57 2.1 9.3 7.6 17.5 15.8 23.5 12.9 9.5 31.5 12.7 49.8 8.5 13.5-3.1 25.7-9.8 34.1-19.1 10.1-11 14.3-24.8 11.3-37.9z m-54.3 17.8c-7.7 1.7-14.3 0.3-17.1-1.7 1-2.3 5.7-6.9 14.7-9 7.8-1.7 14.3-0.3 17.5 1.1-0.4 1.9-5.2 7.4-15.1 9.6zM731.3 464.8l-139.6-151-3-2.8c-38.7-31-87.9-42.5-133.7-32.3-40.1 8.9-73.1 33.7-90.6 68-18.8 36.8-18.3 84.2-17.8 130.1 0.5 50.2 1.1 102.1-24.7 130.4-26 28.6-54 35.8-86.3 44.1-34.7 8.9-74 19-111.5 56.6-28.7 28.8-43.1 67.4-39.3 105.9 3 30.7 19.2 76.5 79.3 119.8l0.7 0.5c73 52.2 175.5 14.7 221.1-19.4 0.7-0.4 1.2-1 1.8-1.4 1.5-1.2 3.2-2.4 4.6-3.5l-0.2-0.3c0.6-0.7 1.4-1 2-1.7 8.6-11.3 5.8-27.5-6.1-36-9.9-7.1-22.8-6.3-31.8 0.5l-0.3-0.3c-59 34.1-114.1 55.2-161.1 21.6-35.2-25.4-55.2-54.2-58.1-83.4-2.3-24.1 6.9-48.5 25.4-67 27.8-27.8 55.7-35 88.1-43.3 35.2-9.1 75.2-19.3 111.3-59.1 38.5-42.4 37.9-103.9 37.2-163.4-0.5-41.9-0.9-81.4 12.5-107.7 10.8-21.1 31.4-36.5 56.6-42.1 28.2-6.3 58.7 0.3 83.6 18.2 1.1 0.8 2.3 1.6 3.4 2.5L692.3 497c49.3 57.6 48.2 110.2-3.4 165.6-61.9 65.9-124.7 96.7-180.2 123l0.1 0.2c-3.4 1.7-6.5 4-9 7.2-8.6 11.3-5.8 27.5 6.1 36 8.4 6 19.1 6.4 27.8 2.2l0.1 0.2c55.7-26.5 128.7-65.1 194-134.6 68.9-74 70.4-154 3.5-232zM524.1 242.4c4.1 3 8.6 5.4 13.3 7.2 37.4 13.9 81.5-15.2 100.5-66.3 16.2-43.6 8.2-88.3-19.6-108.7-4.1-3-8.6-5.4-13.3-7.2-18.8-7-40.8-3-60.1 11-17.5 12.6-31.8 32.2-40.4 55.3-16.2 43.6-8.2 88.3 19.6 108.7z m16.7-93.1c5.5-14.8 14.7-27.7 25.2-35.3 5-3.6 14.8-9.2 23.9-5.8 1.4 0.5 2.8 1.3 4 2.2 11.2 8.2 16.6 33.3 6.3 61-11.4 30.7-35.1 46.3-49.1 41.1-1.4-0.5-2.8-1.3-4-2.2-11.1-8.2-16.6-33.3-6.3-61z m104.8 181.2c27.5 20.4 71.3 5.7 99.7-33.5 28.4-39.2 29.1-85.8 1.6-106.2-27.5-20.4-71.3-5.7-99.7 33.5-28.4 39.1-29.1 85.8-1.6 106.2z m74.8-103.1c3.4 2.5 4.9 21.2-10.9 43s-33.9 26-37.3 23.5c-3.4-2.5-4.9-21.2 11-43.1 15.7-21.8 33.8-26 37.2-23.4z',
trash: trash:
'M750.5 938.9H278.6c-53.3 0-96.6-39.8-96.6-88.7V255h-66.5C85.7 255 64 244.3 64 229.6s21.7-25.4 51.5-25.4h793c29.8 0 51.5 10.7 51.5 25.4S938.3 255 908.5 255h-61.4v595.2c0 48.9-43.3 88.7-96.6 88.7zM230.1 255v595.2c0 22.4 21.8 40.6 48.6 40.6h471.8c26.8 0 48.6-18.2 48.6-40.6V255h-569z m408.8 628.6c-15.8 0-27.3-21.7-27.3-51.6V513.2c0-29.9 11.5-51.6 27.3-51.6s27.3 21.7 27.3 51.6V832c0 29.9-11.5 51.6-27.3 51.6z m-127.4 0c-15.8 0-27.3-21.7-27.3-51.6V513.2c0-29.9 11.5-51.6 27.3-51.6s27.3 21.7 27.3 51.6V832c0 29.9-11.4 51.6-27.3 51.6z m-127.4-1c-15.8 0-27.3-21.7-27.3-51.6V512.2c0-29.9 11.5-51.6 27.3-51.6s27.3 21.7 27.3 51.6V831c0.1 29.9-11.4 51.6-27.3 51.6z m389.8-746.8H250.1c-29.8 0-51.5-10.7-51.5-25.4S220.3 85 250.1 85h523.8c29.8 0 51.5 10.7 51.5 25.4 0 14.8-21.7 25.4-51.5 25.4z', 'M750.5 938.9H278.6c-53.3 0-96.6-39.8-96.6-88.7V255h-66.5C85.7 255 64 244.3 64 229.6s21.7-25.4 51.5-25.4h793c29.8 0 51.5 10.7 51.5 25.4S938.3 255 908.5 255h-61.4v595.2c0 48.9-43.3 88.7-96.6 88.7zM230.1 255v595.2c0 22.4 21.8 40.6 48.6 40.6h471.8c26.8 0 48.6-18.2 48.6-40.6V255h-569z m408.8 628.6c-15.8 0-27.3-21.7-27.3-51.6V513.2c0-29.9 11.5-51.6 27.3-51.6s27.3 21.7 27.3 51.6V832c0 29.9-11.5 51.6-27.3 51.6z m-127.4 0c-15.8 0-27.3-21.7-27.3-51.6V513.2c0-29.9 11.5-51.6 27.3-51.6s27.3 21.7 27.3 51.6V832c0 29.9-11.4 51.6-27.3 51.6z m-127.4-1c-15.8 0-27.3-21.7-27.3-51.6V512.2c0-29.9 11.5-51.6 27.3-51.6s27.3 21.7 27.3 51.6V831c0.1 29.9-11.4 51.6-27.3 51.6z m389.8-746.8H250.1c-29.8 0-51.5-10.7-51.5-25.4S220.3 85 250.1 85h523.8c29.8 0 51.5 10.7 51.5 25.4 0 14.8-21.7 25.4-51.5 25.4z',
'trigon-down':
'M960 279.7c0-18-5.5-33.5-16.6-46.7-11.1-13.2-24.2-19.7-39.4-19.6H120c-15.2 0-28.3 6.6-39.4 19.6-11.1 13.1-16.7 28.7-16.6 46.7 0.1 18 5.6 33.6 16.6 46.7l392 464.6c11.1 13.1 24.2 19.6 39.4 19.6s28.4-6.6 39.4-19.6l392-464.6c11.1-13.1 16.6-28.6 16.6-46.7z',
'trigon-up':
'M960 744.3c0 18-5.5 33.5-16.6 46.7-11.1 13.2-24.2 19.7-39.4 19.6H120c-15.2 0-28.3-6.6-39.4-19.6-11.1-13.1-16.7-28.7-16.6-46.7 0.1-18 5.6-33.6 16.6-46.7l392-464.6c11.1-13.1 24.2-19.6 39.4-19.6s28.4 6.6 39.4 19.6l392 464.6c11.1 13.1 16.6 28.6 16.6 46.7z',
unmute: unmute:
'M517.3 924.1c-19.4 0-40.5-9.8-60.4-28.4L262.3 710h-119C92.9 710 64 681.1 64 630.8V392.9c0-51.1 28.1-79.2 79.2-79.2h119L457 128c27.1-25.4 57.7-34.3 82-23.7 25.7 11.1 40.4 41.7 40.4 84v647.1c0 42.4-14.8 73.1-40.5 84.3-6.9 2.9-14.1 4.4-21.6 4.4zM167 377c-30.8 0-39.7 8.9-39.7 39.7V607c0 31.6 8.2 39.7 39.7 39.7h130.1l2.3 2.5c84.6 89.9 145.7 153.4 181.5 188.7 19 18.7 26.3 17 27.6 16.5 1.3-0.5 7.6-4.6 7.6-31.8V203.3c0-27.5-6-30.7-6.6-31-1.5-0.7-8.2-1.2-28.3 18.5-58.4 57.2-159.6 155.3-189.2 184l-2.3 2.2H167z m644.8 454.6c-14.8 9.1-33.4 5.6-42.8-6.6-7.6-9.9-8.1-24.4-1-36 1.3-1.4 3.2-3.3 5.4-5.8 27.2-29.1 47-49.6 64-76.1 10.2-15.9 19.3-32.6 27.1-49.9 22.4-49.6 33.7-102.5 33.7-157.3 0-99.6-38.1-194.4-107.4-266.7-1.6-1.7-3.3-3.5-4.9-5.2-6.9-12.4-4.9-28 5-38 10.2-10.3 26.3-12.5 39-5 3 3.2 6 6.4 9 9.5 78 83.5 121 191.8 121 305.4 0 63-13 124-38.6 181.1-24.6 55-59.7 103.9-104.2 145.5l-5.3 5.1z m-97.5-119.8c-11.9 7.3-27 6.5-37.3-1.8-11.9-9.6-15.2-27.3-7.2-41.5 1.6-1.9 3.2-3.7 4.9-5.6 36.5-42.1 56.7-95.7 56.7-151 0-56.6-20.9-111.1-58.8-153.6l-5.4-6c-6.4-13-3.2-28.8 7.8-38.2 11-9.5 27.1-10.3 39-2 3.1 3.4 6.3 6.8 9.4 10.2 45.2 53.1 70 120.3 70 189.6 0 71.3-26.2 140.1-73.7 193.8l-5.4 6.1z', 'M517.3 924.1c-19.4 0-40.5-9.8-60.4-28.4L262.3 710h-119C92.9 710 64 681.1 64 630.8V392.9c0-51.1 28.1-79.2 79.2-79.2h119L457 128c27.1-25.4 57.7-34.3 82-23.7 25.7 11.1 40.4 41.7 40.4 84v647.1c0 42.4-14.8 73.1-40.5 84.3-6.9 2.9-14.1 4.4-21.6 4.4zM167 377c-30.8 0-39.7 8.9-39.7 39.7V607c0 31.6 8.2 39.7 39.7 39.7h130.1l2.3 2.5c84.6 89.9 145.7 153.4 181.5 188.7 19 18.7 26.3 17 27.6 16.5 1.3-0.5 7.6-4.6 7.6-31.8V203.3c0-27.5-6-30.7-6.6-31-1.5-0.7-8.2-1.2-28.3 18.5-58.4 57.2-159.6 155.3-189.2 184l-2.3 2.2H167z m644.8 454.6c-14.8 9.1-33.4 5.6-42.8-6.6-7.6-9.9-8.1-24.4-1-36 1.3-1.4 3.2-3.3 5.4-5.8 27.2-29.1 47-49.6 64-76.1 10.2-15.9 19.3-32.6 27.1-49.9 22.4-49.6 33.7-102.5 33.7-157.3 0-99.6-38.1-194.4-107.4-266.7-1.6-1.7-3.3-3.5-4.9-5.2-6.9-12.4-4.9-28 5-38 10.2-10.3 26.3-12.5 39-5 3 3.2 6 6.4 9 9.5 78 83.5 121 191.8 121 305.4 0 63-13 124-38.6 181.1-24.6 55-59.7 103.9-104.2 145.5l-5.3 5.1z m-97.5-119.8c-11.9 7.3-27 6.5-37.3-1.8-11.9-9.6-15.2-27.3-7.2-41.5 1.6-1.9 3.2-3.7 4.9-5.6 36.5-42.1 56.7-95.7 56.7-151 0-56.6-20.9-111.1-58.8-153.6l-5.4-6c-6.4-13-3.2-28.8 7.8-38.2 11-9.5 27.1-10.3 39-2 3.1 3.4 6.3 6.8 9.4 10.2 45.2 53.1 70 120.3 70 189.6 0 71.3-26.2 140.1-73.7 193.8l-5.4 6.1z',
upload: upload:

View File

@ -19,7 +19,8 @@
} }
.item { .item {
min-width: 32px; min-width: 36px;
width: auto;
--padding: 0; --padding: 0;
margin: 0 5px; margin: 0 5px;
--icon-size: 12px; --icon-size: 12px;
@ -29,7 +30,7 @@
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
height: 32px; height: 36px;
background: var(--color-teal-1); background: var(--color-teal-1);
color: #fff; color: #fff;
} }
@ -37,7 +38,7 @@
input { input {
width: 48px; width: 48px;
height: 32px; height: 36px;
padding: 0 4px; padding: 0 4px;
border: 2px solid var(--color-plain-2); border: 2px solid var(--color-plain-2);
border-radius: 4px; border-radius: 4px;
@ -152,7 +153,7 @@ export default class Pager {
} }
state = { state = {
totalpage: 0 totalpage: 1
} }
__init__() { __init__() {
@ -185,10 +186,10 @@ export default class Pager {
return LAYOUT_DICT.prev(curr === 1) return LAYOUT_DICT.prev(curr === 1)
case 'next': case 'next':
return LAYOUT_DICT.next(curr === totalpage) return LAYOUT_DICT.next(curr >= totalpage)
case 'end': case 'end':
return LAYOUT_DICT.end(curr === totalpage) return LAYOUT_DICT.end(curr >= totalpage)
case 'curr': case 'curr':
return LAYOUT_DICT.curr(curr) return LAYOUT_DICT.curr(curr)
@ -226,7 +227,8 @@ export default class Pager {
n = +n n = +n
if (n > 0) { if (n > 0) {
this.props.pagesize = n this.props.pagesize = n
this.state.totalpage = Math.ceil(this.props.total / n) this.state.totalpage = Math.ceil(this.props.total / n) || 1
this.props.page = 1
this.update() this.update()
} }
} }
@ -235,14 +237,14 @@ export default class Pager {
n = +n n = +n
if (n > 0) { if (n > 0) {
this.props.total = n this.props.total = n
this.state.totalpage = Math.ceil(n / this.props.pagesize) this.state.totalpage = Math.ceil(n / this.props.pagesize) || 1
this.update() this.update()
} }
} }
mounted() { mounted() {
var { pagesize, total } = this.props var { pagesize, total } = this.props
this.state.totalpage = Math.ceil(total / pagesize) this.state.totalpage = Math.ceil(total / pagesize) || 1
this.update() this.update()
@ -252,6 +254,10 @@ export default class Pager {
let { totalpage } = this.state let { totalpage } = this.state
let num = +ev.target.dataset.act let num = +ev.target.dataset.act
if (ev.target.disabled) {
return
}
if (num !== num) { if (num !== num) {
num = ev.target.dataset.act num = ev.target.dataset.act
} }