-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from EralChen/dev
Dev
- Loading branch information
Showing
58 changed files
with
1,326 additions
and
337 deletions.
There are no files selected for viewing
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,58 @@ | ||
<script lang="ts" setup> | ||
import { ElMenu, ElIcon } from 'element-plus' | ||
import { Document } from '@element-plus/icons-vue' | ||
import type { RouteRecordRaw } from 'vue-router' | ||
import { VkRoutesMenuContent } from '@vunk-plus/components/routes-menu-content' | ||
const constRoutes = [ | ||
{ | ||
path: '/ui', | ||
name: 'ui', | ||
children: [ | ||
{ | ||
path: 'menu', | ||
name: 'menu', | ||
children: [{ | ||
path: 'subItem1', | ||
name: 'subItem1', | ||
children: [ | ||
{ | ||
path: 'subItem1-1', | ||
name: 'subItem1-1', | ||
}, | ||
{ | ||
path: 'subItem1-2', | ||
name: 'subItem1-1', | ||
}, | ||
], | ||
}], | ||
}, | ||
], | ||
}, | ||
] as unknown as RouteRecordRaw[] | ||
</script> | ||
<template> | ||
<ElMenu :collapse="false"> | ||
<VkRoutesMenuContent | ||
:data="constRoutes" :popper-class="'vk-routes-menu-content-popper'" | ||
> | ||
<template #item> | ||
<ElIcon><Document></Document></ElIcon> | ||
</template> | ||
|
||
<template #itemTitle="{data, href}"> | ||
{{ data.meta?.name || data.name }} | ||
href: {{ href }} | ||
</template> | ||
|
||
<template #menuTitle="{ data }"> | ||
<ElIcon><Document></Document></ElIcon> | ||
{{ data.meta?.name || data.name }} | ||
</template> | ||
</VkRoutesMenuContent> | ||
</ElMenu> | ||
</template> |
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,84 @@ | ||
<script lang="ts" setup> | ||
import { ElMenu, ElIcon } from 'element-plus' | ||
import { VkRoutesMenuContent } from '@vunk-plus/components/routes-menu-content' | ||
import { Document } from '@element-plus/icons-vue' | ||
import { RouteRecordRaw } from 'vue-router' | ||
const constRoutes = [ | ||
{ | ||
path: '/ui', | ||
name: 'ui', | ||
meta: { | ||
title: 'UI', | ||
}, | ||
children: [ | ||
{ | ||
path: 'menu', | ||
name: 'menu', | ||
children: [{ | ||
path: 'subItem1', | ||
name: 'subItem1', | ||
children: [ | ||
{ | ||
path: 'subItem1-1', | ||
name: 'subItem1-1', | ||
meta: { | ||
title: 'subItem1-1', | ||
}, | ||
}, | ||
{ | ||
path: 'subItem1-2', | ||
name: 'subItem1-1', | ||
meta: { | ||
title: 'subItem1-2', | ||
}, | ||
}, | ||
], | ||
}], | ||
}, | ||
], | ||
}, | ||
] as unknown as RouteRecordRaw[] | ||
</script> | ||
<template> | ||
<ElMenu> | ||
<VkRoutesMenuContent | ||
:data="constRoutes" | ||
> | ||
<template #item="{ data, href }"> | ||
<a | ||
:href="href" | ||
class="demo-routes-menu-content-a" | ||
:title="data.meta?.title" | ||
> | ||
<ElIcon> | ||
<Document></Document> | ||
</ElIcon> | ||
</a> | ||
</template> | ||
|
||
<template #itemTitle="{ data }"> | ||
<span>{{ data.meta?.title || data.meta?.name }}</span> | ||
</template> | ||
|
||
<template #menuTitle="{ data }"> | ||
<span>{{ data.meta?.title || data.meta?.name }}</span> | ||
</template> | ||
</VkRoutesMenuContent> | ||
</ElMenu> | ||
</template> | ||
|
||
<style> | ||
.demo-routes-menu-content-a{ | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
right: 0; | ||
bottom: 0; | ||
color: var(--el-color-primary); | ||
} | ||
</style> |
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,20 @@ | ||
<script lang="ts"> | ||
import { defineComponent } from 'vue' | ||
export default defineComponent({ | ||
props: { | ||
to: { | ||
type: String, | ||
default: '', | ||
}, | ||
}, | ||
}) | ||
</script> | ||
<template> | ||
<a | ||
class="menu-link" | ||
:href="to" | ||
> | ||
{{ to }} | ||
</a> | ||
</template> | ||
|
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,114 @@ | ||
<script lang="tsx" setup> | ||
import { ElTable } from 'element-plus' | ||
import { VkTableColumns, __VkTableColumns } from '@vunk-plus/components/table-columns' | ||
import { computed, ref } from 'vue' | ||
import { sleep } from '@vunk/shared/promise' | ||
const children = ref<__VkTableColumns.Source[]>([]) | ||
const colsSource = computed< __VkTableColumns.Source[]>(() => [ | ||
{ | ||
prop: 'date', | ||
label: '日期', | ||
}, | ||
{ | ||
label: '个人信息', | ||
children: children.value, | ||
}, | ||
{ | ||
label: 'xxx', | ||
prop: 'xxx', | ||
fixed: '', | ||
}, | ||
]) | ||
const data = ref([ | ||
{ | ||
date: '2016-05-03', | ||
name: 'Tom', | ||
state: 'California', | ||
city: 'Los Angeles', | ||
address: 'No. 189, Grove St, Los Angeles', | ||
zip: 'CA 90036', | ||
}, | ||
{ | ||
date: '2016-05-02', | ||
name: 'Tom', | ||
state: 'California', | ||
city: 'Los Angeles', | ||
address: 'No. 189, Grove St, Los Angeles', | ||
zip: 'CA 90036', | ||
}, | ||
{ | ||
date: '2016-05-04', | ||
name: 'Tom', | ||
state: 'California', | ||
city: 'Los Angeles', | ||
address: 'No. 189, Grove St, Los Angeles', | ||
zip: 'CA 90036', | ||
}, | ||
{ | ||
date: '2016-05-01', | ||
name: 'Tom', | ||
state: 'California', | ||
city: 'Los Angeles', | ||
address: 'No. 189, Grove St, Los Angeles', | ||
zip: 'CA 90036', | ||
}, | ||
{ | ||
date: '2016-05-08', | ||
name: 'Tom', | ||
state: 'California', | ||
city: 'Los Angeles', | ||
address: 'No. 189, Grove St, Los Angeles', | ||
zip: 'CA 90036', | ||
}, | ||
{ | ||
date: '2016-05-06', | ||
name: 'Tom', | ||
state: 'California', | ||
city: 'Los Angeles', | ||
address: 'No. 189, Grove St, Los Angeles', | ||
zip: 'CA 90036', | ||
}, | ||
{ | ||
date: '2016-05-07', | ||
name: 'Tom', | ||
state: 'California', | ||
city: 'Los Angeles', | ||
address: 'No. 189, Grove St, Los Angeles', | ||
zip: 'CA 90036', | ||
}, | ||
]) | ||
const setColChildren = async () => { | ||
await sleep(1000) | ||
children.value = children.value.length ? [] : [ | ||
{ | ||
prop: 'name', | ||
label: '名称', | ||
width: '200px', | ||
}, | ||
{ | ||
label: '其他', | ||
children: [], | ||
}, | ||
] | ||
} | ||
setColChildren() | ||
</script> | ||
<template> | ||
<p> | ||
<ElButton @click="setColChildren"> | ||
setColChildren | ||
</ElButton> | ||
</p> | ||
|
||
|
||
<ElTable :data="data"> | ||
<VkTableColumns | ||
:align="'center'" | ||
:source="colsSource" | ||
></VkTableColumns> | ||
</ElTable> | ||
</template> |
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,87 @@ | ||
<script lang="tsx" setup> | ||
import { ElTable } from 'element-plus' | ||
import { VkTableColumns, __VkTableColumns } from '@vunk-plus/components/table-columns' | ||
import { computed, ref } from 'vue' | ||
const colsSource = computed< __VkTableColumns.Source[]>(() => [ | ||
{ | ||
prop: 'date', | ||
label: '日期', | ||
}, | ||
{ | ||
label: 'xxx', | ||
prop: 'xxx', | ||
fixed: 'right', | ||
hidden: true, | ||
}, | ||
]) | ||
const data = ref([ | ||
{ | ||
date: '2016-05-03', | ||
name: 'Tom', | ||
state: 'California', | ||
city: 'Los Angeles', | ||
address: 'No. 189, Grove St, Los Angeles', | ||
zip: 'CA 90036', | ||
}, | ||
{ | ||
date: '2016-05-02', | ||
name: 'Tom', | ||
state: 'California', | ||
city: 'Los Angeles', | ||
address: 'No. 189, Grove St, Los Angeles', | ||
zip: 'CA 90036', | ||
}, | ||
{ | ||
date: '2016-05-04', | ||
name: 'Tom', | ||
state: 'California', | ||
city: 'Los Angeles', | ||
address: 'No. 189, Grove St, Los Angeles', | ||
zip: 'CA 90036', | ||
}, | ||
{ | ||
date: '2016-05-01', | ||
name: 'Tom', | ||
state: 'California', | ||
city: 'Los Angeles', | ||
address: 'No. 189, Grove St, Los Angeles', | ||
zip: 'CA 90036', | ||
}, | ||
{ | ||
date: '2016-05-08', | ||
name: 'Tom', | ||
state: 'California', | ||
city: 'Los Angeles', | ||
address: 'No. 189, Grove St, Los Angeles', | ||
zip: 'CA 90036', | ||
}, | ||
{ | ||
date: '2016-05-06', | ||
name: 'Tom', | ||
state: 'California', | ||
city: 'Los Angeles', | ||
address: 'No. 189, Grove St, Los Angeles', | ||
zip: 'CA 90036', | ||
}, | ||
{ | ||
date: '2016-05-07', | ||
name: 'Tom', | ||
state: 'California', | ||
city: 'Los Angeles', | ||
address: 'No. 189, Grove St, Los Angeles', | ||
zip: 'CA 90036', | ||
}, | ||
]) | ||
</script> | ||
<template> | ||
<ElTable :data="data"> | ||
<VkTableColumns | ||
:align="'center'" | ||
:source="colsSource" | ||
></VkTableColumns> | ||
</ElTable> | ||
</template> |
Oops, something went wrong.