<script>
import Table from './Table.svelte';
import List from './List.svelte';
import data from './data';
let config = {
name: {
name: '魚名',
formatter: (d) => `<strong>${d.name}</strong>`,
align: 'left',
},
price: {
name: '價格',
formatter: (d) => new Intl.NumberFormat('zh-Hans', { style: 'currency', currency: 'TWD' }).format(d.price),
align: 'right',
sortable: true,
comparator: (a, b) => a.price - b.price,
},
price15: {
formatter: d => d.price * 1.5,
name: '1.5 倍價格',
},
place: {
name: '出現地點',
align: 'center',
},
season: {
align: 'right',
name: '客製化欄位',
component: List,
}
}
</script>
<Table config={config} data={data}>
<h2>
動物之森 - 魚類列表