-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 💄💄[style] - 调整代码格式 * 💄💄[style] - 完善代码风格 * 🎨🎨 [doc] 基础表格完善 * 💡💡[doc] - 添加treeTable基本Demo * 🚧[wip]: 菜单完善 * merge * ➕[comp]:新增Alert组件 * ➕ [demo] 新增Modal菜单Demo * 🔥🔥[doc] add new demo * Revert "Merge branch 'master' of github.com:Ya2gLu/vben3" This reverts commit 1bc05be, reversing changes made to b49f48f. * Revert "Revert "Merge branch 'master' of github.com:Ya2gLu/vben3"" This reverts commit ce60779. * update lock.yaml
- Loading branch information
Showing
28 changed files
with
2,395 additions
and
2,126 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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,6 @@ | ||
<script lang="ts" setup> | ||
import { Modal } from '@vben/demo' | ||
</script> | ||
<template> | ||
<Modal /> | ||
</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,6 @@ | ||
<script lang="ts" setup> | ||
import { TreeTable } from "@vben/demo" | ||
</script> | ||
<template> | ||
<TreeTable /> | ||
</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
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
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 |
---|---|---|
@@ -1,6 +1,66 @@ | ||
<script lang="ts" setup></script> | ||
<script lang="ts" setup> | ||
import { ref, reactive } from 'vue' | ||
const aTitle = ref<string>('基础卡片') | ||
const aContent = ref('别有幽愁暗恨生,此时无声胜有声.') | ||
let tabsType = ref<string>('line') | ||
const radioArr = reactive([{ value: 'line', label: 'line' }, { value: 'bar', label: 'bar' }, { value: 'card', label: 'card' }, { value: 'segment', label: 'segment' }]) | ||
function radioChange(e: Event) { | ||
tabsType.value = (e.target as HTMLInputElement).value | ||
return console.log('val ->', (e.target as HTMLInputElement).value); | ||
} | ||
function handleClose() { | ||
return | ||
} | ||
</script> | ||
|
||
<template> | ||
<div class="p-2"> | ||
<VbenCard class="w-1/3" title="title">content</VbenCard> | ||
<div class="p-2 h-full grid grid-cols-12 gap-4"> | ||
|
||
<div class="col-start-1 col-span-6 "> | ||
<VbenCard :title="aTitle"> {{ aContent }} </VbenCard> | ||
</div> | ||
|
||
<div class="col-start-7 col-span-6 "> | ||
<VbenCard contentStyle="padding: 0"> | ||
<VbenTabs :type="tabsType" size="large" :tabsPadding="20" paneStyle="padding: 20px;"> | ||
<VbenTabPane name="tabs1"> | ||
这是一个Tabs卡片(👁️🐽👁️) | ||
<p> 你可以选择Tabs的类型: </p> | ||
<!-- TODO: VbenRadioGroup似乎有bug,点击后的样式无法正常显示 --> | ||
<!-- TODO: VbenRadioGroup tabsType设置默认值后不起作用 --> | ||
<VbenRadioGroup name="radio-group" :value="tabsType" :options="radioArr" | ||
@change="radioChange" /> | ||
</VbenTabPane> | ||
<VbenTabPane name="tabs2">我本将心向明月,奈何明月照沟渠.</VbenTabPane> | ||
</VbenTabs> | ||
</VbenCard> | ||
</div> | ||
|
||
<div class="col-start-1 col-span-3"> | ||
<VbenCard title="带封面的卡片" hoverable> | ||
<template #cover> | ||
<img src="@/assets/images/cover.png" alt="cover.png"> | ||
</template> | ||
样式丰富了许多,不是吗🥳 | ||
</VbenCard> | ||
</div> | ||
|
||
<div class="col-start-7 col-span-6"> | ||
<VbenCard title="提示" closable @close="handleClose"> | ||
有时候我们需要在插槽里定制一些丰富的交互🤔 | ||
<template #action> | ||
<VbenSpace> | ||
<VbenButton strong secondary type="tertiary">不用了</VbenButton> | ||
<VbenButton strong secondary type="primary">确定</VbenButton> | ||
</VbenSpace> | ||
</template> | ||
</VbenCard> | ||
</div> | ||
|
||
</div> | ||
</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,48 @@ | ||
<script lang="ts" setup> | ||
import { ref } from 'vue'; | ||
let alertInfo = ref('这个模态框本质是一个弹出的遮罩层,在遮罩层里你可以定义任意类型的 Card, Dialog, 或者不定义😶🌫️, Vben并没有封装默认的类型,所以你可以根据自己的实际业务定制😋') | ||
let defaultModalShow = ref(false) | ||
let isModalShow = ref(false) | ||
const cTitle = ref('这个模态框里装了一个卡片📇') | ||
const cContent = ref('🚧山重水复疑无路🚧') | ||
const aTitle = ref('Card类型的Modal') | ||
const bTitle = ref("默认的Modal") | ||
const dTitle = ref('Dialog类型的Modal') | ||
</script> | ||
|
||
<template> | ||
<div class="m-2 grid grid-cols-12 gap-4"> | ||
<div class="col-start-1 col-span-8"> | ||
<VbenAlert type="info" :bordered="false">{{ alertInfo }}</VbenAlert> | ||
</div> | ||
<div class="col-start-1 col-span-3"> | ||
<VbenCard :title="bTitle"> | ||
<VbenButton @click="defaultModalShow = true">点我</VbenButton> | ||
</VbenCard> | ||
</div> | ||
<div class="col-start-4 col-span-3"> | ||
<VbenCard :title="aTitle"> | ||
<VbenButton @click="isModalShow = true">点我</VbenButton> | ||
</VbenCard> | ||
</div> | ||
|
||
<div class="col-start-7 col-span-3"> | ||
<VbenCard :title="dTitle"> | ||
<VbenButton>点我</VbenButton> | ||
</VbenCard> | ||
</div> | ||
|
||
<VbenModal :show="defaultModalShow" @maskClick="() => defaultModalShow = !defaultModalShow"> | ||
<p>这是默认的样式,没有任何样式,会弹出一个遮罩层,你可以自己定义🥸</p> | ||
</VbenModal> | ||
|
||
<VbenModal :show="isModalShow" @maskClick="() => isModalShow = !isModalShow"> | ||
<VbenCard class="w-1/2" :title="cTitle" role="dialog">{{ cContent }}</VbenCard> | ||
</VbenModal> | ||
|
||
</div> | ||
</template> | ||
|
||
<style lang="less" scoped></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,66 @@ | ||
<script lang="ts" setup> | ||
import { Data, treeColumns } from './schemas' | ||
import { getTreeTableData } from '../apis/table' | ||
import { ref, reactive } from 'vue' | ||
const treeData = reactive<Data>({ | ||
table: { | ||
items: [], | ||
total: 0, | ||
}, | ||
}) | ||
const treeTable = ref(null) | ||
getTreeTableData().then((res: any) => { | ||
console.log('treeData:', res) | ||
treeData.table.items = res | ||
}).catch((err) => { | ||
console.log('err:', err) | ||
}) | ||
function toggleExpandChangeEvent(e: any) { | ||
console.log( | ||
'节点展开事件', | ||
e.expanded, | ||
'获取父节点:', | ||
e.$table.getParentRow(e.row), | ||
) | ||
return | ||
} | ||
function handleSelected() { | ||
return null | ||
} | ||
function handleExpanded() { | ||
return null | ||
} | ||
function handleExpandAll() { | ||
return null | ||
} | ||
function handleCloseAll() { | ||
return null | ||
} | ||
</script> | ||
<template> | ||
<div class="p-2 h-full"> | ||
<VbenTable ref="treeTableRef" :options="{ title: '基础树形表格', border: 'inner', pagination: true, }" | ||
:tree-config="{ transform: true, rowField: 'id', parentField: 'parentId', iconOpen: 'vxe-icon-square-minus', iconClose: 'vxe-icon-square-plus', }" | ||
:column-config="{ resizable: true }" :columns="treeColumns" :data="treeData.table.items" | ||
:checkbox-config="{ labelField: 'id', highlight: true }" @toggle-tree-expand="toggleExpandChangeEvent"> | ||
> | ||
<template #toolbar> | ||
<div class="pb-2"> | ||
<VbenButton class="ml-2" type="info" @click="handleSelected">获取选中</VbenButton> | ||
<VbenButton class="ml-2" type="info" @click="handleExpanded">获取已展开</VbenButton> | ||
<VbenButton class="ml-2" type="info" @click="handleExpandAll">展开所有</VbenButton> | ||
<VbenButton class="ml-2" type="info" @click="handleCloseAll">关闭所有</VbenButton> | ||
</div> | ||
</template> | ||
</VbenTable> | ||
</div> | ||
</template> | ||
|
||
<style lang="less" scoped></style> |
Oops, something went wrong.