<template> <div> <med-button type="danger" @click="visible = true"> 点我出弹层 </med-button> <med-s-modal v-model="visible" title="我是标题" @cancel="cancel"> 我是弹层内容 </med-s-modal> </div> </template> <script> export default { data() { return { visible: false, } }, methods: { cancel() { console.log('用户点击了取消!') }, } } </script>
<template> <div> <med-button type="danger" @click="visible = true"> 点我出弹层 </med-button> <med-s-modal size="large" v-model="visible" title="我是标题" @ok="ok" @cancel="cancel"> 我是弹层内容 </med-s-modal> </div> </template> <script> export default { data() { return { visible: false, } }, methods: { ok() { console.log('用户点击了ok!') }, cancel() { console.log('用户点击了取消!') }, } } </script>
<template> <div> <med-button type="danger" @click="visible = true"> 点我出弹层 </med-button> <med-s-modal v-model="visible" title="我是标题" @cancel="cancel"> 我是弹层内容 <template #footer> <med-button>自定义按钮</med-button> </template> </med-s-modal> </div> </template> <script> export default { data() { return { visible: false, } }, methods: { cancel() { console.log('用户点击了取消!') }, } } </script>
Pin卡贴 Transfer穿梭框