Skip to content

Commit

Permalink
refactor(indexes): sfc to tsx (#1327)
Browse files Browse the repository at this point in the history
* refactor(indexes): sfc to tsx

* refactor(indexes): sfc to tsx

* test: 临时屏蔽toMatchSnapshot

* chore: test update
  • Loading branch information
liweijie0812 authored Apr 22, 2024
1 parent e24486c commit 5cdcc89
Show file tree
Hide file tree
Showing 8 changed files with 139 additions and 161 deletions.
91 changes: 41 additions & 50 deletions src/indexes/__test__/__snapshots__/demo.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -15,64 +15,64 @@ exports[`Indexes > Indexes baseVue demo works fine 1`] = `
class="t-indexes__sidebar-item"
data-index="A"
>
A
<!--v-if-->
A
<!---->
</div>
<div
class="t-indexes__sidebar-item"
data-index="B"
>
B
<!--v-if-->
B
<!---->
</div>
<div
class="t-indexes__sidebar-item"
data-index="C"
>
C
<!--v-if-->
C
<!---->
</div>
<div
class="t-indexes__sidebar-item"
data-index="D"
>
D
<!--v-if-->
D
<!---->
</div>
<div
class="t-indexes__sidebar-item"
data-index="E"
>
E
<!--v-if-->
E
<!---->
</div>
<div
class="t-indexes__sidebar-item"
data-index="F"
>
F
<!--v-if-->
F
<!---->
</div>
<div
class="t-indexes__sidebar-item"
data-index="G"
>
G
<!--v-if-->
G
<!---->
</div>
<div
class="t-indexes__sidebar-item"
data-index="J"
>
J
<!--v-if-->
J
<!---->
</div>
<div
class="t-indexes__sidebar-item"
data-index="K"
>
K
<!--v-if-->
K
<!---->
</div>
</div>
Expand All @@ -89,8 +89,7 @@ exports[`Indexes > Indexes baseVue demo works fine 1`] = `
<div
class="t-indexes-anchor__slot"
>
<!---->
</div>
<div
class="t-indexes-anchor__header"
Expand Down Expand Up @@ -293,8 +292,7 @@ exports[`Indexes > Indexes baseVue demo works fine 1`] = `
<div
class="t-indexes-anchor__slot"
>
<!---->
</div>
<div
class="t-indexes-anchor__header"
Expand Down Expand Up @@ -592,8 +590,7 @@ exports[`Indexes > Indexes baseVue demo works fine 1`] = `
<div
class="t-indexes-anchor__slot"
>
<!---->
</div>
<div
class="t-indexes-anchor__header"
Expand Down Expand Up @@ -986,8 +983,7 @@ exports[`Indexes > Indexes baseVue demo works fine 1`] = `
<div
class="t-indexes-anchor__slot"
>
<!---->
</div>
<div
class="t-indexes-anchor__header"
Expand Down Expand Up @@ -1266,8 +1262,7 @@ exports[`Indexes > Indexes baseVue demo works fine 1`] = `
<div
class="t-indexes-anchor__slot"
>
<!---->
</div>
<div
class="t-indexes-anchor__header"
Expand Down Expand Up @@ -1356,8 +1351,7 @@ exports[`Indexes > Indexes baseVue demo works fine 1`] = `
<div
class="t-indexes-anchor__slot"
>
<!---->
</div>
<div
class="t-indexes-anchor__header"
Expand Down Expand Up @@ -1522,8 +1516,7 @@ exports[`Indexes > Indexes baseVue demo works fine 1`] = `
<div
class="t-indexes-anchor__slot"
>
<!---->
</div>
<div
class="t-indexes-anchor__header"
Expand Down Expand Up @@ -1745,8 +1738,7 @@ exports[`Indexes > Indexes baseVue demo works fine 1`] = `
<div
class="t-indexes-anchor__slot"
>
<!---->
</div>
<div
class="t-indexes-anchor__header"
Expand Down Expand Up @@ -1987,8 +1979,7 @@ exports[`Indexes > Indexes baseVue demo works fine 1`] = `
<div
class="t-indexes-anchor__slot"
>
<!---->
</div>
<div
class="t-indexes-anchor__header"
Expand Down Expand Up @@ -2106,50 +2097,50 @@ exports[`Indexes > Indexes customVue demo works fine 1`] = `
class="t-indexes__sidebar-item"
data-index="1"
>
1
<!--v-if-->
1
<!---->
</div>
<div
class="t-indexes__sidebar-item"
data-index="3"
>
3
<!--v-if-->
3
<!---->
</div>
<div
class="t-indexes__sidebar-item"
data-index="5"
>
5
<!--v-if-->
5
<!---->
</div>
<div
class="t-indexes__sidebar-item"
data-index="7"
>
7
<!--v-if-->
7
<!---->
</div>
<div
class="t-indexes__sidebar-item"
data-index="8"
>
8
<!--v-if-->
8
<!---->
</div>
<div
class="t-indexes__sidebar-item"
data-index="10"
>
10
<!--v-if-->
10
<!---->
</div>
<div
class="t-indexes__sidebar-item"
data-index="#"
>
#
<!--v-if-->
#
<!---->
</div>
</div>
Expand Down
49 changes: 21 additions & 28 deletions src/indexes/__test__/__snapshots__/index.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -12,50 +12,50 @@ exports[`Indexes & IndexesAnchor > render 1`] = `
class="t-indexes__sidebar-item"
data-index="1"
>
1
<!--v-if-->
1
<!---->
</div>
<div
class="t-indexes__sidebar-item"
data-index="3"
>
3
<!--v-if-->
3
<!---->
</div>
<div
class="t-indexes__sidebar-item"
data-index="5"
>
5
<!--v-if-->
5
<!---->
</div>
<div
class="t-indexes__sidebar-item"
data-index="7"
>
7
<!--v-if-->
7
<!---->
</div>
<div
class="t-indexes__sidebar-item"
data-index="8"
>
8
<!--v-if-->
8
<!---->
</div>
<div
class="t-indexes__sidebar-item"
data-index="10"
>
10
<!--v-if-->
10
<!---->
</div>
<div
class="t-indexes__sidebar-item"
data-index="#"
>
#
<!--v-if-->
#
<!---->
</div>
</div>
Expand All @@ -71,8 +71,7 @@ exports[`Indexes & IndexesAnchor > render 1`] = `
<div
class="t-indexes-anchor__slot"
>
<!---->
</div>
<div
class="t-indexes-anchor__header"
Expand Down Expand Up @@ -190,8 +189,7 @@ exports[`Indexes & IndexesAnchor > render 1`] = `
<div
class="t-indexes-anchor__slot"
>
<!---->
</div>
<div
class="t-indexes-anchor__header"
Expand Down Expand Up @@ -309,8 +307,7 @@ exports[`Indexes & IndexesAnchor > render 1`] = `
<div
class="t-indexes-anchor__slot"
>
<!---->
</div>
<div
class="t-indexes-anchor__header"
Expand Down Expand Up @@ -428,8 +425,7 @@ exports[`Indexes & IndexesAnchor > render 1`] = `
<div
class="t-indexes-anchor__slot"
>
<!---->
</div>
<div
class="t-indexes-anchor__header"
Expand Down Expand Up @@ -547,8 +543,7 @@ exports[`Indexes & IndexesAnchor > render 1`] = `
<div
class="t-indexes-anchor__slot"
>
<!---->
</div>
<div
class="t-indexes-anchor__header"
Expand Down Expand Up @@ -666,8 +661,7 @@ exports[`Indexes & IndexesAnchor > render 1`] = `
<div
class="t-indexes-anchor__slot"
>
<!---->
</div>
<div
class="t-indexes-anchor__header"
Expand Down Expand Up @@ -785,8 +779,7 @@ exports[`Indexes & IndexesAnchor > render 1`] = `
<div
class="t-indexes-anchor__slot"
>
<!---->
</div>
<div
class="t-indexes-anchor__header"
Expand Down
4 changes: 2 additions & 2 deletions src/indexes/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { withInstall, WithInstallType } from '../shared';
import LocalIndexes from './indexes.vue';
import LocalIndexesAnchor from './indexes-anchor.vue';
import LocalIndexes from './indexes';
import LocalIndexesAnchor from './indexes-anchor';

import './style';

Expand Down
Loading

0 comments on commit 5cdcc89

Please sign in to comment.