mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 10:44:59 +00:00
feat: add popover component
This commit is contained in:
60
src/popover/demo/index.vue
Normal file
60
src/popover/demo/index.vue
Normal file
@@ -0,0 +1,60 @@
|
||||
<template>
|
||||
<demo-section>
|
||||
<demo-block :title="t('basicUsage')">
|
||||
<van-popover
|
||||
v-model="show.basic"
|
||||
:actions="t('actions')"
|
||||
placement="bottom-left"
|
||||
>
|
||||
<van-button @click="show.basic = true">
|
||||
{{ t('showPopover') }}
|
||||
</van-button>
|
||||
</van-popover>
|
||||
</demo-block>
|
||||
|
||||
<demo-block :title="t('lightTheme')">
|
||||
<van-popover
|
||||
v-model="show.lightTheme"
|
||||
theme="light"
|
||||
:actions="t('actions')"
|
||||
placement="bottom-left"
|
||||
>
|
||||
<van-button @click="show.lightTheme = true">
|
||||
{{ t('lightTheme') }}
|
||||
</van-button>
|
||||
</van-popover>
|
||||
</demo-block>
|
||||
</demo-section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
i18n: {
|
||||
'zh-CN': {
|
||||
actions: [{ text: '文本' }, { text: '文本' }, { text: '文本' }],
|
||||
lightTheme: '浅色风格',
|
||||
showPopover: '点击弹出气泡',
|
||||
},
|
||||
'en-US': {
|
||||
actions: [{ text: 'Text' }, { text: 'Text' }, { text: 'Text' }],
|
||||
lightTheme: 'Light Theme',
|
||||
showPopover: 'Show Popover',
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
show: {
|
||||
basic: false,
|
||||
lightTheme: false,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
@import '../../style/var';
|
||||
</style>
|
Reference in New Issue
Block a user