Skip to content

Commit

Permalink
docs: format docs and add ajax bar zhCN doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackman99 committed Jan 3, 2023
1 parent ad9bbb8 commit da25e08
Show file tree
Hide file tree
Showing 45 changed files with 441 additions and 139 deletions.
12 changes: 9 additions & 3 deletions packages/docs/components/data-presentation/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const items = [
{ label: 'Grapes' },
]
</script>
<template>
<c-list :items="items" />
</template>
Expand All @@ -38,6 +39,7 @@ const items = [
]
const size = ref('md')
</script>
<template>
<div class="c-row c-items-center c-gutter-md c-wrap">
<div
Expand Down Expand Up @@ -69,6 +71,7 @@ const items = [
{ label: 'Grapes' },
]
</script>
<template>
<c-list
:items="items"
Expand All @@ -91,6 +94,7 @@ const items = [
]
const activeItem = ref('Banana')
</script>
<template>
<c-list
:items="items"
Expand All @@ -110,10 +114,10 @@ This is an example for using `c-info-item` as `item`
import { ref } from 'vue'
import {
matCheck,
matSettingsPower,
matPersonAddAlt1,
matOfflineBolt,
matPersonAddAlt1,
matSettings,
matSettingsPower,
} from '@quasar/extras/material-icons/index'
const items = [
{ title: 'Notification', subtitle: 'Some notification description', icon: matOfflineBolt },
Expand All @@ -123,14 +127,15 @@ const items = [
]
const activeItem = ref('')
</script>
<template>
<c-list
:items="items"
clickable
:active-fn="item => item.title === activeItem"
@item-click="item => (activeItem = item.title)"
>
<template #item="{ isActive, clickable, item }">
<template #item="{ isActive, item }">
<c-info-item v-bind="item">
<template
v-if="isActive"
Expand All @@ -145,6 +150,7 @@ const activeItem = ref('')
</template>
</c-list>
</template>
<style
scoped
lang="scss"
Expand Down
3 changes: 3 additions & 0 deletions packages/docs/components/data-presentation/table.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const tableColumns = [
{ title: 'Gender', field: 'gender' },
]
</script>
<template>
<c-table
row-key="name"
Expand All @@ -53,6 +54,7 @@ const tableColumns = [
{ title: 'Gender', field: 'gender' },
]
</script>
<template>
<c-table row-key="name" :data="tableData" :columns="tableColumns">
<template #th-name="{ title }">
Expand All @@ -79,6 +81,7 @@ const tableColumns = [
{ title: 'Operations', field: 'operations' },
]
</script>
<template>
<c-table row-key="name" :data="tableData" :columns="tableColumns">
<template #td-operations>
Expand Down
30 changes: 21 additions & 9 deletions packages/docs/components/feedback/dialog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ componentPath: popup/CDialog
import { ref } from 'vue'
const show = ref(false)
</script>
<template>
<c-dialog v-model="show" title="Hi, there">
<div>Hello, world</div>
Expand All @@ -26,6 +27,7 @@ const show = ref(false)
import { ref } from 'vue'
const show = ref(false)
</script>
<template>
<c-dialog
v-model="show"
Expand All @@ -46,6 +48,7 @@ const show = ref(false)
import { ref } from 'vue'
const show = ref(false)
</script>
<template>
<c-dialog
v-model="show"
Expand All @@ -67,6 +70,7 @@ const show = ref(false)
import { ref } from 'vue'
const show = ref(false)
</script>
<template>
<c-dialog
v-model="show"
Expand All @@ -88,9 +92,9 @@ const show = ref(false)
<script setup>
import {
matArrowBack,
matArrowUpward,
matArrowForward,
matArrowDownward,
matArrowForward,
matArrowUpward,
matFullscreenExit,
} from '@quasar/extras/material-icons/index'
import { ref } from 'vue'
Expand All @@ -105,6 +109,7 @@ const openWithPosition = (h, v) => {
show.value = true
}
</script>
<template>
<c-dialog
v-model="show"
Expand Down Expand Up @@ -192,10 +197,11 @@ import { ref } from 'vue'
import { matPeople } from '@quasar/extras/material-icons/index'
const show = ref(false)
</script>
<template>
<c-dialog v-model="show">
<template #title>
<img class="title-icon" src="/logo-dark.svg" />
<img class="title-icon" src="/logo-dark.svg">
</template>
<template #close-icon>
<c-icon :content="matPeople" />
Expand All @@ -219,6 +225,7 @@ const show = ref(false)
</c-dialog>
<c-button label="Open Dialog" @click="show = true" />
</template>
<style scoped>
.title-icon {
width: 80px;
Expand All @@ -236,18 +243,20 @@ const top = ref(false)
const right = ref(false)
const bottom = ref(false)
</script>
<template>
<c-dialog
v-model="left"
exchange-animation-direction
title="Left Drawer"
:rounded="false"
:custom-style="{
height: '100vh'
height: '100vh',
}"
width="80vw"
vertical-align="center"
horizontal-align="start">
horizontal-align="start"
>
内容
</c-dialog>
<c-dialog
Expand All @@ -257,10 +266,11 @@ const bottom = ref(false)
:rounded="false"
width="80vw"
:custom-style="{
height: '100vh'
height: '100vh',
}"
vertical-align="center"
horizontal-align="end">
horizontal-align="end"
>
Content
</c-dialog>
<c-dialog
Expand All @@ -269,7 +279,8 @@ const bottom = ref(false)
:rounded="false"
width="100vw"
vertical-align="start"
horizontal-align="center">
horizontal-align="center"
>
Content
</c-dialog>
<c-dialog
Expand All @@ -278,7 +289,8 @@ const bottom = ref(false)
:rounded="false"
width="100vw"
vertical-align="end"
horizontal-align="center">
horizontal-align="center"
>
Content
</c-dialog>
<div class="c-row c-items-center c-wrap c-gutter-md">
Expand Down
8 changes: 4 additions & 4 deletions packages/docs/components/feedback/drawer.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ const show = ref(false)
/>
<CDrawer
title="Hi, there"
v-model="show"
title="Hi, there"
>
Some drawer content
</CDrawer>
Expand All @@ -33,9 +33,9 @@ const show = ref(false)
import { ref } from 'vue'
import {
matArrowBack,
matArrowUpward,
matArrowForward,
matArrowDownward,
matArrowForward,
matArrowUpward,
} from '@quasar/extras/material-icons/index'
const show = ref(false)
Expand Down Expand Up @@ -84,9 +84,9 @@ function openWithPosition(pos) {
</div>
<c-drawer
v-model="show"
title="Hi, there"
:position="position"
v-model="show"
>
I'm some drawer content
</c-drawer>
Expand Down
15 changes: 11 additions & 4 deletions packages/docs/components/feedback/notification.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const openWithCount = () => {
})
}
</script>
<template>
<c-button label="Open notification" @click="openWithCount" />
</template>
Expand All @@ -61,6 +62,7 @@ const openWithTheme = (theme) => {
})
}
</script>
<template>
<div class="c-row c-items-center c-wrap c-gutter-md">
<div>
Expand Down Expand Up @@ -97,9 +99,9 @@ const openWithTheme = (theme) => {
<script setup>
import {
matArrowBack,
matArrowUpward,
matArrowForward,
matArrowDownward,
matArrowForward,
matArrowUpward,
matFullscreenExit,
} from '@quasar/extras/material-icons/index'
import { useNotifications } from '@casual-ui/vue'
Expand All @@ -115,6 +117,7 @@ const openWithPosition = (alignX, alignY) => {
})
}
</script>
<template>
<div class="c-row c-gutter-sm">
<div>
Expand Down Expand Up @@ -197,6 +200,7 @@ import { useNotifications } from '@casual-ui/vue'
const { open } = useNotifications()
</script>
<template>
<c-button
label="Open notification"
Expand All @@ -222,7 +226,7 @@ import { useNotifications } from '@casual-ui/vue'
const { open } = useNotifications()
let close = ref(null)
const close = ref(null)
const onClick = () => {
if (!close.value) {
Expand All @@ -232,12 +236,14 @@ const onClick = () => {
timeout: 0,
closeIcon: false,
}).close
} else {
}
else {
close.value()
close.value = null
}
}
</script>
<template>
<c-button
:label="close ? 'Close notification' : 'Open notification'"
Expand Down Expand Up @@ -284,6 +290,7 @@ const openWithDynamicContent = () => {
}, 2000)
}
</script>
<template>
<c-button label="Open dynamic notification" @click="openWithDynamicContent" />
</template>
Expand Down
6 changes: 6 additions & 0 deletions packages/docs/components/feedback/tooltip.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,20 @@ const positions = [
'left-bottom',
]
</script>
<template>
<div class="tooltips">
<c-tooltip
v-for="p in positions"
:key="p"
:content="`A message rom position ${p}`"
:position="p"
>
{{ p }}
</c-tooltip>
</div>
</template>
<style scoped>
.tooltips {
display: grid;
Expand Down Expand Up @@ -79,6 +82,7 @@ const positions = [
</template>
</c-tooltip>
</template>
<style scoped>
.custom-content {
white-space: nowrap;
Expand All @@ -100,6 +104,7 @@ const toggleShow = () => {
show.value = !show.value
}
</script>
<template>
<div class="popups">
<c-tooltip content="Hello, world">
Expand Down Expand Up @@ -135,6 +140,7 @@ const toggleShow = () => {
</div>
</div>
</template>
<style scoped>
.popups {
display: flex;
Expand Down
Loading

0 comments on commit da25e08

Please sign in to comment.