feat: refine demo with browser window, update veui
This commit is contained in:
@@ -75,7 +75,7 @@
|
||||
</veui-fieldset>
|
||||
</veui-form>
|
||||
<section
|
||||
v-for="{ version, codeName, date, changeset } of filteredChangelog"
|
||||
v-for="{ version, codeName, date, changeset } of pagedChangelog"
|
||||
:key="version"
|
||||
class="version-item"
|
||||
data-markdown
|
||||
@@ -114,19 +114,27 @@
|
||||
</ul>
|
||||
</section>
|
||||
<section
|
||||
v-if="filteredChangelog.length === 0"
|
||||
v-if="pagedChangelog.length === 0"
|
||||
class="not-found"
|
||||
@click="updateShrugger"
|
||||
>
|
||||
<span class="emoji">{{ shrugger }} </span>
|
||||
<p>没有符合条件的变更记录。</p>
|
||||
</section>
|
||||
<section class="pagination">
|
||||
<veui-pagination
|
||||
:page="page"
|
||||
:page-size="pageSize"
|
||||
:total="filteredChangelog.length"
|
||||
@redirect="val => page = val"
|
||||
/>
|
||||
</section>
|
||||
</article>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { cloneDeep } from 'lodash'
|
||||
import { Form, Field, Fieldset, CheckboxGroup, Select, Checkbox } from 'veui'
|
||||
import { Form, Field, Fieldset, CheckboxGroup, Select, Checkbox, Pagination } from 'veui'
|
||||
import changelog from '../assets/data/changelog.json'
|
||||
|
||||
const allTypes = [
|
||||
@@ -169,7 +177,8 @@ export default {
|
||||
'veui-fieldset': Fieldset,
|
||||
'veui-checkbox-group': CheckboxGroup,
|
||||
'veui-select': Select,
|
||||
'veui-checkbox': Checkbox
|
||||
'veui-checkbox': Checkbox,
|
||||
'veui-pagination': Pagination
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
@@ -182,7 +191,9 @@ export default {
|
||||
tag: null,
|
||||
from: null,
|
||||
to: allVersions[0].value,
|
||||
shrugger: getShrugger()
|
||||
shrugger: getShrugger(),
|
||||
page: 1,
|
||||
pageSize: 10
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -207,6 +218,10 @@ export default {
|
||||
})
|
||||
|
||||
return result.filter(({ changeset }) => changeset.length !== 0)
|
||||
},
|
||||
pagedChangelog () {
|
||||
const { page, pageSize, filteredChangelog } = this
|
||||
return filteredChangelog.slice((page - 1) * pageSize, page * pageSize)
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -259,6 +274,9 @@ export default {
|
||||
& >>> .veui-field
|
||||
margin-bottom 12px
|
||||
|
||||
& .veui-field
|
||||
margin-bottom 0
|
||||
|
||||
& >>> .veui-field .veui-field-no-label
|
||||
margin-bottom 0
|
||||
|
||||
@@ -360,6 +378,9 @@ h2
|
||||
p
|
||||
margin 0 -0.75em 0 0
|
||||
|
||||
.pagination
|
||||
margin-top 36px
|
||||
|
||||
@keyframes line-enter
|
||||
0%
|
||||
100%
|
||||
|
@@ -10,13 +10,13 @@
|
||||
|
||||
通过 [`collapse-mode`](#props-collapse-mode) 属性指定收起模式,分别是 `slim`(部分收起) / `hidden`(完全收起)。
|
||||
|
||||
[[ demo src="/demo/sidebar/collapse-mode.vue" ]]
|
||||
[[ demo src="/demo/sidebar/collapse-mode.vue" browser="/demo/sidebar/collapse-mode.vue" ]]
|
||||
|
||||
### 展示/隐藏切换按钮
|
||||
|
||||
使用 `collapsible` 属性设置是否显示侧边栏展开/收起按钮。
|
||||
|
||||
[[ demo src="/demo/sidebar/collapsible.vue" ]]
|
||||
[[ demo src="/demo/sidebar/collapsible.vue" browser="/demo/sidebar/collapsible.vue" ]]
|
||||
|
||||
## API
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
| ``collapsible`` | `boolean` | `false` | 是否显示收起/展开按钮。 |
|
||||
| ``collapsed`` | `boolean` | `false` | [^collapsed] |
|
||||
| ``autocollapse`` | `boolean` | `false` | 是否拉伸窗口到一定阈值时自动收起。 |
|
||||
| ``collapse-mode`` | `'slim' | 'hidden'` | `'slim'` | 收起模式,分别是 `slim`(部分收起)/`hidden`(完全收起)。
|
||||
| ``collapse-mode`` | `'slim' | 'hidden'` | `'slim'` | 收起模式,分别是 `slim`(部分收起)/`hidden`(完全收起)。
|
||||
|
||||
^^^collapsed
|
||||
:::badges
|
||||
|
@@ -1,22 +1,20 @@
|
||||
<template>
|
||||
<article>
|
||||
<veui-layout>
|
||||
<veui-header>Header</veui-header>
|
||||
<veui-layout>
|
||||
<veui-header>Header</veui-header>
|
||||
<veui-sidebar>
|
||||
<div class="center full">
|
||||
Sidebar
|
||||
</div>
|
||||
</veui-sidebar>
|
||||
<veui-layout>
|
||||
<veui-sidebar>
|
||||
<div class="center full">
|
||||
Sidebar
|
||||
</div>
|
||||
</veui-sidebar>
|
||||
<veui-layout>
|
||||
<veui-content>Content</veui-content>
|
||||
<veui-footer style="background: #ccc;">
|
||||
Footer(背景仅为演示)
|
||||
</veui-footer>
|
||||
</veui-layout>
|
||||
<veui-content>Content</veui-content>
|
||||
<veui-footer style="background: #ccc;">
|
||||
Footer(背景仅为演示)
|
||||
</veui-footer>
|
||||
</veui-layout>
|
||||
</veui-layout>
|
||||
</article>
|
||||
</veui-layout>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -34,14 +32,6 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
article {
|
||||
height: 100%;
|
||||
|
||||
& > .veui-layout {
|
||||
min-width: 720px;
|
||||
}
|
||||
}
|
||||
|
||||
.center,
|
||||
.veui-layout-header,
|
||||
.veui-layout-footer,
|
||||
|
@@ -1,22 +1,20 @@
|
||||
<template>
|
||||
<article>
|
||||
<veui-layout>
|
||||
<veui-header>Header</veui-header>
|
||||
<veui-layout>
|
||||
<veui-header>Header</veui-header>
|
||||
<veui-sidebar>
|
||||
<div class="center full">
|
||||
Sidebar
|
||||
</div>
|
||||
</veui-sidebar>
|
||||
<veui-layout>
|
||||
<veui-sidebar>
|
||||
<div class="center full">
|
||||
Sidebar
|
||||
</div>
|
||||
</veui-sidebar>
|
||||
<veui-layout>
|
||||
<veui-content>Content</veui-content>
|
||||
</veui-layout>
|
||||
<veui-content>Content</veui-content>
|
||||
</veui-layout>
|
||||
<veui-footer style="background: #ccc;">
|
||||
Footer(背景仅为演示)
|
||||
</veui-footer>
|
||||
</veui-layout>
|
||||
</article>
|
||||
<veui-footer style="background: #ccc;">
|
||||
Footer(背景仅为演示)
|
||||
</veui-footer>
|
||||
</veui-layout>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -38,14 +36,6 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
article {
|
||||
height: 100%;
|
||||
|
||||
& > .veui-layout {
|
||||
min-width: 720px;
|
||||
}
|
||||
}
|
||||
|
||||
.center,
|
||||
.veui-layout-header,
|
||||
.veui-layout-footer,
|
||||
|
@@ -1,22 +1,20 @@
|
||||
<template>
|
||||
<article>
|
||||
<veui-layout>
|
||||
<veui-sidebar>
|
||||
<div class="center full">
|
||||
Sidebar
|
||||
</div>
|
||||
</veui-sidebar>
|
||||
<veui-layout>
|
||||
<veui-sidebar>
|
||||
<div class="center full">
|
||||
Sidebar
|
||||
</div>
|
||||
</veui-sidebar>
|
||||
<veui-header>Header</veui-header>
|
||||
<veui-layout>
|
||||
<veui-header>Header</veui-header>
|
||||
<veui-layout>
|
||||
<veui-content>Content</veui-content>
|
||||
<veui-footer style="background: #ccc;">
|
||||
Footer(背景仅为演示)
|
||||
</veui-footer>
|
||||
</veui-layout>
|
||||
<veui-content>Content</veui-content>
|
||||
<veui-footer style="background: #ccc;">
|
||||
Footer(背景仅为演示)
|
||||
</veui-footer>
|
||||
</veui-layout>
|
||||
</veui-layout>
|
||||
</article>
|
||||
</veui-layout>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -38,14 +36,6 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
article {
|
||||
height: 100%;
|
||||
|
||||
& > .veui-layout {
|
||||
min-width: 720px;
|
||||
}
|
||||
}
|
||||
|
||||
.center,
|
||||
.veui-layout-header,
|
||||
.veui-layout-footer,
|
||||
|
@@ -1,37 +1,35 @@
|
||||
<template>
|
||||
<article>
|
||||
<veui-layout style="--dls-layout-header-height: 64px;">
|
||||
<veui-header sticky>
|
||||
Header
|
||||
</veui-header>
|
||||
<veui-layout style="--dls-layout-header-height: 64px;">
|
||||
<veui-header sticky>
|
||||
Header
|
||||
</veui-header>
|
||||
<veui-layout>
|
||||
<veui-sidebar
|
||||
sticky
|
||||
style="max-height: 320px;"
|
||||
>
|
||||
<div class="center full">
|
||||
Sidebar
|
||||
</div>
|
||||
</veui-sidebar>
|
||||
<veui-layout>
|
||||
<veui-sidebar
|
||||
sticky
|
||||
style="max-height: 320px;"
|
||||
>
|
||||
<div class="center full">
|
||||
<veui-content>
|
||||
<div
|
||||
class="center"
|
||||
style="height: 800px;"
|
||||
>
|
||||
Sidebar
|
||||
</div>
|
||||
</veui-sidebar>
|
||||
<veui-layout>
|
||||
<veui-content>
|
||||
<div
|
||||
class="center"
|
||||
style="height: 800px;"
|
||||
>
|
||||
Sidebar
|
||||
</div>
|
||||
</veui-content>
|
||||
<veui-footer
|
||||
sticky
|
||||
style="background: #ccc;"
|
||||
>
|
||||
Footer(背景仅为演示)
|
||||
</veui-footer>
|
||||
</veui-layout>
|
||||
</veui-content>
|
||||
<veui-footer
|
||||
sticky
|
||||
style="background: #ccc;"
|
||||
>
|
||||
Footer(背景仅为演示)
|
||||
</veui-footer>
|
||||
</veui-layout>
|
||||
</veui-layout>
|
||||
</article>
|
||||
</veui-layout>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -58,14 +56,6 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
article {
|
||||
height: 100%;
|
||||
|
||||
& > .veui-layout {
|
||||
min-width: 720px;
|
||||
}
|
||||
}
|
||||
|
||||
.center,
|
||||
.veui-layout-header,
|
||||
.veui-layout-footer,
|
||||
|
@@ -1,24 +1,28 @@
|
||||
<template>
|
||||
<article>
|
||||
<veui-radio-button-group
|
||||
v-model="mode"
|
||||
:items="modes"
|
||||
/>
|
||||
<div class="mock-window">
|
||||
<veui-layout>
|
||||
<veui-header>Header</veui-header>
|
||||
<veui-layout>
|
||||
<veui-sidebar
|
||||
collapsible
|
||||
:collapse-mode="mode"
|
||||
>
|
||||
<div class="center full">
|
||||
Sidebar
|
||||
</div>
|
||||
</veui-sidebar>
|
||||
<veui-layout>
|
||||
<veui-header>Header</veui-header>
|
||||
<veui-layout>
|
||||
<veui-sidebar :collapse-mode="mode">
|
||||
<div class="center full">Sidebar</div>
|
||||
</veui-sidebar>
|
||||
<veui-layout>
|
||||
<veui-content>Content</veui-content>
|
||||
<veui-footer style="background: #ccc;">Footer(背景仅为演示)</veui-footer>
|
||||
</veui-layout>
|
||||
</veui-layout>
|
||||
<veui-content>
|
||||
<veui-radio-button-group
|
||||
v-model="mode"
|
||||
:items="modes"
|
||||
/>
|
||||
</veui-content>
|
||||
<veui-footer style="background: #ccc;">
|
||||
Footer(背景仅为演示)
|
||||
</veui-footer>
|
||||
</veui-layout>
|
||||
</div>
|
||||
</article>
|
||||
</veui-layout>
|
||||
</veui-layout>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -46,17 +50,6 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.mock-window {
|
||||
height: 384px;
|
||||
transform: translate(0, 0); // bfc for fixed
|
||||
overflow: auto;
|
||||
border: 1px solid #eee;
|
||||
|
||||
& > .veui-layout {
|
||||
min-width: 860px;
|
||||
}
|
||||
}
|
||||
|
||||
.center,
|
||||
.veui-layout-header,
|
||||
.veui-layout-footer,
|
||||
|
@@ -1,24 +1,30 @@
|
||||
<template>
|
||||
<article>
|
||||
<div class="mock-window">
|
||||
<veui-layout>
|
||||
<veui-header>Header</veui-header>
|
||||
<veui-layout>
|
||||
<veui-sidebar :collapsible="collapsible">
|
||||
<div class="center full">
|
||||
Sidebar
|
||||
</div>
|
||||
</veui-sidebar>
|
||||
<veui-layout>
|
||||
<veui-header>Header</veui-header>
|
||||
<veui-layout>
|
||||
<veui-sidebar :collapsible="false">
|
||||
<div class="center full">Sidebar</div>
|
||||
</veui-sidebar>
|
||||
<veui-layout>
|
||||
<veui-content>Content</veui-content>
|
||||
<veui-footer style="background: #ccc;">Footer(背景仅为演示</veui-footer>
|
||||
</veui-layout>
|
||||
</veui-layout>
|
||||
<veui-content>
|
||||
<veui-switch
|
||||
v-model="collapsible"
|
||||
>
|
||||
Collapsible
|
||||
</veui-switch>
|
||||
</veui-content>
|
||||
<veui-footer style="background: #ccc;">
|
||||
Footer(背景仅为演示
|
||||
</veui-footer>
|
||||
</veui-layout>
|
||||
</div>
|
||||
</article>
|
||||
</veui-layout>
|
||||
</veui-layout>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { Layout, Header, Footer, Sidebar, Content } from 'veui'
|
||||
import { Layout, Header, Footer, Sidebar, Content, Switch } from 'veui'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -26,21 +32,18 @@ export default {
|
||||
'veui-header': Header,
|
||||
'veui-footer': Footer,
|
||||
'veui-sidebar': Sidebar,
|
||||
'veui-content': Content
|
||||
'veui-content': Content,
|
||||
'veui-switch': Switch
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
collapsible: true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.mock-window {
|
||||
height: 384px;
|
||||
transform: translate(0, 0); // bfc for fixed
|
||||
|
||||
& > .veui-layout {
|
||||
min-width: 860px;
|
||||
}
|
||||
}
|
||||
|
||||
.center,
|
||||
.veui-layout-header,
|
||||
.veui-layout-footer,
|
||||
|
@@ -1,23 +1,21 @@
|
||||
<template>
|
||||
<article>
|
||||
<veui-layout>
|
||||
<veui-header>Header</veui-header>
|
||||
<veui-layout>
|
||||
<veui-header>Header</veui-header>
|
||||
<veui-sidebar collapsible>
|
||||
<veui-sidenav
|
||||
:items="items"
|
||||
collapsible
|
||||
/>
|
||||
</veui-sidebar>
|
||||
<veui-layout>
|
||||
<veui-sidebar collapsible>
|
||||
<veui-sidenav
|
||||
:items="items"
|
||||
collapsible
|
||||
/>
|
||||
</veui-sidebar>
|
||||
<veui-layout>
|
||||
<veui-content>Content</veui-content>
|
||||
<veui-footer style="background: #ccc;">
|
||||
Footer(背景仅为演示)
|
||||
</veui-footer>
|
||||
</veui-layout>
|
||||
<veui-content>Content</veui-content>
|
||||
<veui-footer style="background: #ccc;">
|
||||
Footer(背景仅为演示)
|
||||
</veui-footer>
|
||||
</veui-layout>
|
||||
</veui-layout>
|
||||
</article>
|
||||
</veui-layout>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -113,14 +111,6 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
article {
|
||||
height: 100%;
|
||||
|
||||
& > .veui-layout {
|
||||
min-width: 720px;
|
||||
}
|
||||
}
|
||||
|
||||
.veui-layout-header,
|
||||
.veui-layout-footer,
|
||||
.veui-layout-content {
|
||||
|
Reference in New Issue
Block a user