Skip to content

Commit

Permalink
Merge pull request #9 from shiouhoo/cascader
Browse files Browse the repository at this point in the history
Cascader
  • Loading branch information
shiouhoo committed Apr 20, 2024
2 parents 2020276 + 25165ba commit e1e16a5
Show file tree
Hide file tree
Showing 20 changed files with 2,526 additions and 530 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ jobs:
with:
folder: docs/.vitepress/dist

- name: Install Serverless CLI
run: npm install -g @serverless-devs/s
- name: Serverless Config
run: s config add --AccessKeyID ${{secrets.ACCESS_KEY_ID}} --AccessKeySecret ${{secrets.ACCESS_KEY_SECRET}} -a default -f
- name: Prepare deployment directory
run: |
mkdir deploy
cp -r docs/.vitepress/dist deploy/hooui
cp -r .serverless/* deploy
mv deploy/hooui/index.html deploy/index.html
- name: Deploy to Aliyun Serverless
run: s deploy -y --use-local -t .serverless/s.yaml
# - name: Install Serverless CLI
# run: npm install -g @serverless-devs/s
# - name: Serverless Config
# run: s config add --AccessKeyID ${{secrets.ACCESS_KEY_ID}} --AccessKeySecret ${{secrets.ACCESS_KEY_SECRET}} -a default -f
# - name: Prepare deployment directory
# run: |
# mkdir deploy
# cp -r docs/.vitepress/dist deploy/hooui
# cp -r .serverless/* deploy
# mv deploy/hooui/index.html deploy/index.html
# - name: Deploy to Aliyun Serverless
# run: s deploy -y --use-local -t .serverless/s.yaml
15 changes: 12 additions & 3 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ export default defineConfig({
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: 'directive', link: '/directive/', activeMatch: '/directive' },
{ text: 'components', link: '/package/expandcontainer', activeMatch: '/package' },
{ text: 'components', link: '/package/', activeMatch: '/package' },
{ text: '工具函数', link: '/utils/download', activeMatch: '/utils' },
{ text: 'hooks', link: '/hooks/useFullScreen', activeMatch: '/hooks' }
{ text: 'hooks', link: '/hooks/useFullScreen', activeMatch: '/hooks' },
{ text: 'other', link: '/other/unocssConfig', activeMatch: '/other' }
],

sidebar: {
directive: [
{
text: '自定义指令',
items: [
{ text: 'index', link: '/directive/' },
{ text: 'loading', link: '/directive/loading' },
{ text: 'copy', link: '/directive/copy' },
]
Expand All @@ -50,6 +50,7 @@ export default defineConfig({
{
text: '输入组件',
items: [
{ text: 'cascader-radio', link: '/package/cascader-radio' },
{ text: 'expandcontainer', link: '/package/expandcontainer' },
{ text: 'searchscopeinput', link: '/package/searchscopeinput' },
]
Expand Down Expand Up @@ -77,6 +78,14 @@ export default defineConfig({
{ text: 'useTabScroll', link: '/hooks/useTabScroll' },
]
}
],
other: [
{
text: 'other',
items: [
{ text: 'unocss配置', link: '/other/unocssConfig' },
]
}
]
},

Expand Down
2 changes: 1 addition & 1 deletion docs/.vitepress/layout/AsideTop.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<template v-if="show" #sidebar-nav-before>
<div class="wrapper">
<span>是否使用 unocss:</span>
<a-switch :checked="preferUnocss" @change="toggleUnocssAPI" />
<a-switch :checked="preferUnocss" @change="toggleUnocssAPI" ></a-switch>
</div>
</template>
<template #nav-bar-title-after>
Expand Down
5 changes: 5 additions & 0 deletions docs/.vitepress/theme/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,9 @@
background-color: #141414 !important;
border-color: var(--vp-c-border) !important;
}
}


.demoblock-view{
overflow: initial !important;
}
45 changes: 45 additions & 0 deletions docs/other/unocssConfig.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
```ts
// unocss.config.ts
import { defineConfig, presetAttributify, presetWind } from 'unocss';

export default defineConfig({
shortcuts: {
'flex-center': 'flex items-center justify-center',
},
theme: {
colors: {
primary: '#ff0000',
},
},
presets: [
presetAttributify(),
presetWind(),
],
rules: [
[/^scrollbar-([^-]+)(-(.+))?$/, ([, d,, value], { rawSelector }) => {
let p = '';
if (!value) {
p = `width: ${d}; height: ${d}`;
}
if (d === 'w') {
p = `width: ${value}`;
} else if (p === 'h') {
p = `height: ${value}`;
}
return `.${rawSelector}::-webkit-scrollbar {
${p}
}`;
}],
// 文本超出省略
// usage: class="ellipsis ellipsis-2 ellipsis-3"
[/^ellipsis(-(\d*))?$/, ([,, d], { rawSelector }) => {
return `.${rawSelector} {${
Number(d) > 1
? `overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: ${d}; -webkit-box-orient: vertical;`
: 'overflow: hidden; text-overflow: ellipsis; white-space: nowrap;'
}}`;
}],
],
});

```
Loading

0 comments on commit e1e16a5

Please sign in to comment.