|
16 | 16 | </template> |
17 | 17 |
|
18 | 18 | <script setup lang="ts"> |
19 | | -import { TmlWaterfall } from 'tml-ui' |
| 19 | +import { TmlWaterfall } from '@tml/tml-ui' |
20 | 20 |
|
21 | 21 | const items = [ |
22 | 22 | { id: 1, image: '/img1.jpg', title: '标题 1', description: '描述...' }, |
@@ -78,7 +78,7 @@ const items = [ |
78 | 78 |
|
79 | 79 | <script setup lang="ts"> |
80 | 80 | import { ref } from 'vue' |
81 | | -import { TmlWaterfall } from 'tml-ui' |
| 81 | +import { TmlWaterfall } from '@tml/tml-ui' |
82 | 82 |
|
83 | 83 | const items = ref([...Array(20).keys()].map(i => ({ id: i, content: `Item ${i}` }))) |
84 | 84 | const loading = ref(false) |
@@ -122,7 +122,7 @@ const handleReachBottom = async ({ atBottom }: { atBottom: boolean }) => { |
122 | 122 |
|
123 | 123 | <script setup lang="ts"> |
124 | 124 | import { ref } from 'vue' |
125 | | -import { TmlWaterfall } from 'tml-ui' |
| 125 | +import { TmlWaterfall } from '@tml/tml-ui' |
126 | 126 |
|
127 | 127 | const items = ref([ |
128 | 128 | { id: 1, content: 'Item 1', height: 150 }, |
@@ -216,16 +216,16 @@ export interface WaterfallEmits { |
216 | 216 | } |
217 | 217 |
|
218 | 218 | // 组件实例类型 |
219 | | -import type { TmlWaterfall } from 'tml-ui' |
| 219 | +import type { TmlWaterfall } from '@tml/tml-ui' |
220 | 220 | ``` |
221 | 221 |
|
222 | 222 | ### 在 TypeScript 中使用 |
223 | 223 |
|
224 | 224 | ```vue |
225 | 225 | <script setup lang="ts"> |
226 | 226 | import { ref } from 'vue' |
227 | | -import { TmlWaterfall } from 'tml-ui' |
228 | | -import type { WaterfallProps, ReachBottomPayload } from 'tml-ui' |
| 227 | +import { TmlWaterfall } from '@tml/tml-ui' |
| 228 | +import type { WaterfallProps, ReachBottomPayload } from '@tml/tml-ui' |
229 | 229 |
|
230 | 230 | // 定义组件配置 |
231 | 231 | const waterfallConfig: WaterfallProps = { |
@@ -298,7 +298,7 @@ const loadMoreData = async (): Promise<void> => { |
298 | 298 |
|
299 | 299 | <script setup lang="ts"> |
300 | 300 | import { ref } from 'vue' |
301 | | -import { TmlWaterfall } from 'tml-ui' |
| 301 | +import { TmlWaterfall } from '@tml/tml-ui' |
302 | 302 |
|
303 | 303 | const waterfallRef = ref() |
304 | 304 |
|
@@ -335,7 +335,7 @@ const handleReachBottom = (payload) => { |
335 | 335 |
|
336 | 336 | ```vue |
337 | 337 | <script setup> |
338 | | -import { TmlWaterfall } from 'tml-ui' |
| 338 | +import { TmlWaterfall } from '@tml/tml-ui' |
339 | 339 |
|
340 | 340 | const images = ref([...]) |
341 | 341 | </script> |
@@ -392,7 +392,7 @@ const images = ref([...]) |
392 | 392 | ```vue |
393 | 393 | <script setup> |
394 | 394 | import { ref } from 'vue' |
395 | | -import { TmlWaterfall } from 'tml-ui' |
| 395 | +import { TmlWaterfall } from '@tml/tml-ui' |
396 | 396 |
|
397 | 397 | const items = ref([]) |
398 | 398 | const loading = ref(false) |
@@ -480,8 +480,8 @@ const handleReachBottom = async ({ atBottom }) => { |
480 | 480 | ```vue |
481 | 481 | <script setup lang="ts"> |
482 | 482 | import { ref, onMounted } from 'vue' |
483 | | -import { TmlWaterfall } from 'tml-ui' |
484 | | -import type { ReachBottomPayload } from 'tml-ui' |
| 483 | +import { TmlWaterfall } from '@tml/tml-ui' |
| 484 | +import type { ReachBottomPayload } from '@tml/tml-ui' |
485 | 485 |
|
486 | 486 | interface ImageItem { |
487 | 487 | id: number |
|
0 commit comments