Commit f7c2406d authored by 毛线's avatar 毛线

修改demo组件

parent 6d2ee4be
...@@ -3,15 +3,21 @@ ...@@ -3,15 +3,21 @@
<h2 v-if="$slots.title" > <h2 v-if="$slots.title" >
<slot name="title"/> <slot name="title"/>
</h2> </h2>
<p v-if="$slots.descript" > <div v-if="$slots.descript" class="descript" >
<slot name="descript"/> <slot name="descript"/>
</p> </div>
<div class="demo-content"> <div class="demo-content">
<slot /> <slot />
<div v-if="showCode" :class="[hoverControl ? 'hover' : '',]" class="footer" @mouseenter="hoverControl = true" @mouseleave="hoverControl = false" @click="showCode = !showCode">
<i :class="footerIcon"/>
<transition name="fade">
<span v-if="hover"><span class="label">{{ footerLabel }}</span></span>
</transition>
</div>
<div v-if="showCode" class="demo-code"> <div v-if="showCode" class="demo-code">
<slot name="code" class="code" /> <slot name="code" class="code" />
</div> </div>
<div> <div v-if="$slots.code" >
<div :class="[hoverControl ? 'hover' : '',]" class="footer" @mouseenter="hoverControl = true" @mouseleave="hoverControl = false" @click="showCode = !showCode"> <div :class="[hoverControl ? 'hover' : '',]" class="footer" @mouseenter="hoverControl = true" @mouseleave="hoverControl = false" @click="showCode = !showCode">
<i :class="footerIcon"/> <i :class="footerIcon"/>
<transition name="fade"> <transition name="fade">
...@@ -48,17 +54,21 @@ export default { ...@@ -48,17 +54,21 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.demo-block{ .demo-block{
overflow: auto;
margin-bottom: 20px;
::v-deep .el-card__body{ ::v-deep .el-card__body{
padding: 0; padding: 0;
} }
&.hover{ &.hover{
.demo-content{ box-shadow: 0 0 8px 0 rgb(232 237 250 / 60%), 0 2px 4px 0 rgb(232 237 250 / 50%);
box-shadow: 0 0 8px 0 rgb(232 237 250 / 60%), 0 2px 4px 0 rgb(232 237 250 / 50%);
}
.footer{ .footer{
transform: translateX(-30px); transform: translateX(-30px);
} }
} }
.descript{
white-space: pre-wrap;
margin: 10px 0;
}
.demo-code{ .demo-code{
background: #ebebeb; background: #ebebeb;
padding: 10px; padding: 10px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment