File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ import { readFileSync , writeFileSync } from 'node:fs' ;
2+
3+ function migrateTimeline ( ) {
4+ const filePath = 'src/timeline/timeline.tsx' ;
5+ let content = readFileSync ( filePath , 'utf8' ) ;
6+ if ( content . includes ( 'const instance = getCurrentInstance();' ) ) {
7+ content = content . replace ( 'const instance = getCurrentInstance();' , 'const instance = getCurrentInstance().proxy;' ) ;
8+ content = content . replaceAll ( 'instance.slots' , 'instance.$slots' ) ;
9+ writeFileSync ( filePath , content , 'utf8' ) ;
10+ }
11+ }
12+
13+ function migrateTimelineItem ( ) {
14+ const filePath = 'src/timeline/timeline-item.tsx' ;
15+ let content = readFileSync ( filePath , 'utf8' ) ;
16+ if ( content . includes ( 'const instance = getCurrentInstance();' ) ) {
17+ content = content . replace ( 'const instance = getCurrentInstance();' , 'const instance = getCurrentInstance().proxy;' ) ;
18+ content = content . replaceAll ( 'instance.parent.slots' , 'instance.$parent.$slots' ) ;
19+ writeFileSync ( filePath , content , 'utf8' ) ;
20+ }
21+ }
22+
23+ export default function ( ) {
24+ migrateTimeline ( ) ;
25+ migrateTimelineItem ( ) ;
26+ }
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import migrateRenderTNode from './utils/render-tnode.mjs';
1111import migrateHooks from './hooks/index.mjs' ;
1212import migrateUpload from './components/upload.mjs' ;
1313import migrateTable from './components/table.mjs' ;
14+ import migrateTimeline from './components/timeline.mjs' ;
1415import migrateSelect from './components/select.mjs' ;
1516import migrateRangeInput from './components/range-input.mjs' ;
1617import migrateSelectInput from './components/select-input.mjs' ;
@@ -27,6 +28,7 @@ function run() {
2728 migrateSelect ( ) ;
2829 migrateSelectInput ( ) ;
2930 migrateTable ( ) ;
31+ migrateTimeline ( ) ;
3032 migrateTree ( ) ;
3133 migrateRangeInput ( ) ;
3234
You can’t perform that action at this time.
0 commit comments