Skip to content

Commit

Permalink
fix(Demo): demo-block-control样式问题;代码展开/收起的操作区未遮挡语言的问题
Browse files Browse the repository at this point in the history
fix #8 #9
  • Loading branch information
xinlei3166 committed Oct 21, 2021
1 parent daf93e9 commit a6f0e55
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
6 changes: 4 additions & 2 deletions components/Demo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ export default {
const innerHeight = window.innerHeight || document.body.clientHeight
fixedControl.value = bottom > innerHeight && top + 44 <= innerHeight
control.value.style.left = fixedControl.value ? `${left}px` : '0'
control.value.style.width = `${demoBlock.value.offsetWidth}px`
const dv = fixedControl.value ? 1 : 2
control.value.style.width = `${demoBlock.value.offsetWidth - dv}px`
}
const scrollHandler = throttle(_scrollHandler, 200)
const removeScrollHandler = () => {
Expand All @@ -154,6 +155,7 @@ export default {
if (!val) {
fixedControl.value = false
control.value.style.left = '0'
control.value.style.width = `${demoBlock.value.offsetWidth - 2}px`
removeScrollHandler()
return
}
Expand Down Expand Up @@ -253,7 +255,7 @@ export default {
bottom: 0;
/* width: calc(100% - 320px - 48px - 200px - 1px); */
border-right: solid 1px #eaeefb;
z-index: 1;
z-index: 2;
}
.demo-block-control .control-icon {
Expand Down
27 changes: 27 additions & 0 deletions docs/guide/card.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,30 @@ const title = ref<any>('vitepress-theme-demoblock')
```

:::

## 基础用法

基础的卡片用法。

:::demo 使用`size``style`属性来定义 Card 的样式。

```vue
<template>
<div class="card-wrap">
<div class="card">xxx</div>
<div class="card">xxx</div>
<div class="card">xxx</div>
</div>
</template>
```
:::

## 基础用法

基础的卡片用法。

:::demo 使用`size``style`属性来定义 Card 的样式。

```vue
```
:::

0 comments on commit a6f0e55

Please sign in to comment.