Drawer 抽屉
使用指南
<script>
import iDrawer from 'iview-mpvue/dist/components/drawer/drawer'
export default {
components: {
'i-drawer': iDrawer
}
}
</script>import 'iview-mpvue/dist/components/drawer/style/css'示例
<i-button v-on:click="toggleLeft1" type="ghost">左边弹出1</i-button>
<i-button v-on:click="toggleLeft2" type="primary">左边弹出2</i-button>
<i-button v-on:click="toggleRight1" type="ghost">右边弹出1</i-button>
<i-button v-on:click="toggleRight2" type="primary">右边弹出2</i-button>
<i-drawer mode="left" :visible="showLeft1" v-on:click="toggleLeft1">
<view class="demo-container">
单击遮罩层关闭
</view>
</i-drawer>
<i-drawer mode="left" :visible="showLeft2" :mask-closable="false">
<view class="demo-container">
禁止单击遮罩关闭
<i-button v-on:click="toggleLeft2" type="primary">关闭</i-button>
</view>
</i-drawer>
<i-drawer mode="right" :visible="showRight1" v-on:click="toggleRight1">
<view class="demo-container">
单击遮罩层关闭
</view>
</i-drawer>
<i-drawer mode="right" :visible="showRight2" :mask-closable="false">
<view class="demo-container">
禁止单击遮罩关闭
<i-button v-on:click="toggleRight2" type="primary">关闭</i-button>
</view>
</i-drawer>API
Last updated
Was this helpful?