-
Notifications
You must be signed in to change notification settings - Fork 834
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
986 additions
and
2,095 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
packages/nutui-taro-demo/src/exhibition/pages/table/align.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<template> | ||
<nut-table :columns="columns" :data="data"></nut-table> | ||
</template> | ||
<script setup lang="ts"> | ||
import { ref } from 'vue'; | ||
const columns = ref([ | ||
{ | ||
title: '姓名', | ||
key: 'name', | ||
align: 'left' | ||
}, | ||
{ | ||
title: '性别', | ||
key: 'sex', | ||
align: 'center' | ||
}, | ||
{ | ||
title: '学历', | ||
key: 'record', | ||
align: 'right' | ||
} | ||
]); | ||
const data = ref([ | ||
{ | ||
name: 'Tom', | ||
sex: '男', | ||
record: '小学' | ||
}, | ||
{ | ||
name: 'Lucy', | ||
sex: '女', | ||
record: '本科' | ||
}, | ||
{ | ||
name: 'Jack', | ||
sex: '男', | ||
record: '高中' | ||
} | ||
]); | ||
</script> |
59 changes: 59 additions & 0 deletions
59
packages/nutui-taro-demo/src/exhibition/pages/table/async.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<template> | ||
<nut-table :columns="columns" :data="data"> | ||
<template #nodata>Loading...</template> | ||
</nut-table> | ||
</template> | ||
<script setup lang="ts"> | ||
import { ref, onMounted } from 'vue'; | ||
const columns = ref([ | ||
{ | ||
title: '姓名', | ||
key: 'name' | ||
}, | ||
{ | ||
title: '性别', | ||
key: 'sex' | ||
}, | ||
{ | ||
title: '学历', | ||
key: 'record' | ||
}, | ||
{ | ||
title: '年龄', | ||
key: 'age' | ||
}, | ||
{ | ||
title: '地址', | ||
key: 'address' | ||
} | ||
]); | ||
const data = ref<Array<any>>([]); | ||
onMounted(() => { | ||
setTimeout(() => { | ||
data.value = [ | ||
{ | ||
address: '北京', | ||
name: 'Tom', | ||
sex: '男', | ||
record: '小学', | ||
age: 13 | ||
}, | ||
{ | ||
record: '本科', | ||
name: 'Lucy', | ||
sex: '女', | ||
age: 34, | ||
address: '上海' | ||
}, | ||
{ | ||
name: 'Jack', | ||
sex: '男', | ||
record: '高中', | ||
age: 4, | ||
address: '杭州' | ||
} | ||
]; | ||
}, 5000); | ||
}); | ||
</script> |
37 changes: 37 additions & 0 deletions
37
packages/nutui-taro-demo/src/exhibition/pages/table/basic.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<template> | ||
<nut-table :columns="columns" :data="data"></nut-table> | ||
</template> | ||
<script setup lang="ts"> | ||
import { ref } from 'vue'; | ||
const columns = ref([ | ||
{ | ||
title: '姓名', | ||
key: 'name' | ||
}, | ||
{ | ||
title: '性别', | ||
key: 'sex' | ||
}, | ||
{ | ||
title: '学历', | ||
key: 'record' | ||
} | ||
]); | ||
const data = ref([ | ||
{ | ||
name: 'Tom', | ||
sex: '男', | ||
record: '小学' | ||
}, | ||
{ | ||
name: 'Lucy', | ||
sex: '女', | ||
record: '本科' | ||
}, | ||
{ | ||
name: 'Jack', | ||
sex: '男', | ||
record: '高中' | ||
} | ||
]); | ||
</script> |
37 changes: 37 additions & 0 deletions
37
packages/nutui-taro-demo/src/exhibition/pages/table/border.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<template> | ||
<nut-table :columns="columns" :data="data" :bordered="false"></nut-table> | ||
</template> | ||
<script setup lang="ts"> | ||
import { ref } from 'vue'; | ||
const columns = ref([ | ||
{ | ||
title: '姓名', | ||
key: 'name' | ||
}, | ||
{ | ||
title: '性别', | ||
key: 'sex' | ||
}, | ||
{ | ||
title: '学历', | ||
key: 'record' | ||
} | ||
]); | ||
const data = ref([ | ||
{ | ||
name: 'Tom', | ||
sex: '男', | ||
record: '小学' | ||
}, | ||
{ | ||
name: 'Lucy', | ||
sex: '女', | ||
record: '本科' | ||
}, | ||
{ | ||
name: 'Jack', | ||
sex: '男', | ||
record: '高中' | ||
} | ||
]); | ||
</script> |
68 changes: 68 additions & 0 deletions
68
packages/nutui-taro-demo/src/exhibition/pages/table/custom.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<template> | ||
<nut-table :columns="columns" :data="data"></nut-table> | ||
</template> | ||
<script setup lang="ts"> | ||
import { ref, h } from 'vue'; | ||
import { Dongdong } from '@nutui/icons-vue-taro'; | ||
const columns = ref([ | ||
{ | ||
title: '姓名', | ||
key: 'name' | ||
}, | ||
{ | ||
title: '性别', | ||
key: 'sex' | ||
}, | ||
{ | ||
title: '学历', | ||
key: 'record' | ||
}, | ||
{ | ||
title: '操作', | ||
key: 'render' | ||
} | ||
]); | ||
const data = ref([ | ||
{ | ||
name: 'Tom', | ||
sex: '男', | ||
record: '小学', | ||
render: () => { | ||
return h( | ||
'button', | ||
{ | ||
onClick: () => { | ||
console.log('hello'); | ||
} | ||
}, | ||
'Hello' | ||
); | ||
} | ||
}, | ||
{ | ||
name: 'Lucy', | ||
sex: '女', | ||
record: '本科', | ||
render: () => { | ||
return h(Dongdong, { width: '14px', height: '14px ' }); | ||
} | ||
}, | ||
{ | ||
name: 'Jack', | ||
sex: '男', | ||
record: '高中', | ||
render: () => { | ||
return h( | ||
'button', | ||
{ | ||
onClick: () => { | ||
window.open('https://www.jd.com'); | ||
} | ||
}, | ||
'打开京东' | ||
); | ||
} | ||
} | ||
]); | ||
</script> |
File renamed without changes.
Oops, something went wrong.