add vitepress docs
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
<template>
|
||||
<div class="demo">
|
||||
<button type="button" class="btn" @click="visible = true" v-text="'打开底部弹层'" />
|
||||
|
||||
<p class="status" v-text="`最近一次操作:${lastAction}`" />
|
||||
|
||||
<bottom-popup
|
||||
v-model="visible"
|
||||
title="选择操作"
|
||||
left-button-text="取消"
|
||||
right-button-text="确定"
|
||||
@left-button-click="onCancel"
|
||||
@right-button-click="onConfirm"
|
||||
>
|
||||
<div class="content">
|
||||
<p v-text="'弹层从视口底部升起,默认带遮罩,内容区可滚动。'" />
|
||||
<p v-text="'标题栏在内容滚动时会吸顶。'" />
|
||||
</div>
|
||||
</bottom-popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from "vue";
|
||||
import { BottomPopup } from "timi-tdesign-mobile";
|
||||
|
||||
const visible = ref(false);
|
||||
const lastAction = ref("无");
|
||||
|
||||
/** 左右按钮只抛事件,关闭与否由业务决定——这里两者都关闭。 */
|
||||
function onCancel() {
|
||||
visible.value = false;
|
||||
lastAction.value = "取消";
|
||||
}
|
||||
|
||||
function onConfirm() {
|
||||
visible.value = false;
|
||||
lastAction.value = "确定";
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.demo {
|
||||
.btn {
|
||||
width: 100%;
|
||||
padding: .625rem;
|
||||
font-size: .875rem;
|
||||
cursor: pointer;
|
||||
border: none;
|
||||
border-radius: .5rem;
|
||||
color: #fff;
|
||||
background: var(--vp-c-brand-1);
|
||||
}
|
||||
|
||||
.status {
|
||||
margin: .75rem 0 0;
|
||||
font-size: .75rem;
|
||||
color: var(--vp-c-text-2);
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: 1rem;
|
||||
|
||||
p {
|
||||
margin: 0 0 .75rem;
|
||||
font-size: .8125rem;
|
||||
line-height: 1.6;
|
||||
color: var(--vp-c-text-2);
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user