国产chinesehdxxxx野外,国产av无码专区亚洲av琪琪,播放男人添女人下边视频,成人国产精品一区二区免费看,chinese丰满人妻videos

Mint UI 彈出框-Popup

2021-09-06 15:09 更新
彈出框,可自定義內(nèi)容。

引入

import { Popup } from 'mint-ui';

Vue.component(Popup.name, Popup);

例子

position 屬性指定了 popup 的位置。比如,position 為 'bottom' 時,popup 會從屏幕下方移入,并最終固定在屏幕下方。移入/移出的動效會根據(jù) position 的不同而自動改變,無需手動配置。

將 v-model 綁定到一個本地變量,通過操作這個變量即可控制 popup 的顯示與隱藏。

<mt-popup
  v-model="popupVisible"
  position="bottom">
  ...
</mt-popup>

若省略 position 屬性,則 popup 會相對于屏幕居中顯示(若不想讓其居中,可通過 CSS 對其重新定位)。此時建議將動效設(shè)置為 popup-fade,這樣在顯示/隱藏時會有淡入/淡出效果。

<mt-popup
  v-model="popupVisible"
  popup-transition="popup-fade">
  ...
</mt-popup>

API

參數(shù) 說明 類型 可選值 默認(rèn)值
position popup 的位置。省略則居中顯示 String 'top'
'right'
'bottom'
'left'
pop-transition 顯示/隱藏時的動效,僅在省略 position 時可配置 String 'popup-fade'
modal 是否創(chuàng)建一個 modal 層 Boolean true
closeOnClickModal 是否可以通過點擊 modal 層來關(guān)閉 popup Boolean true

Slot

name 描述
- 彈出框的內(nèi)容


下面是一個從左側(cè)彈出的實例:

實例

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<!-- 引入樣式 -->

<link rel="stylesheet" rel="external nofollow" target="_blank" >

</head>

<body>

<div id="app">

<mt-button @click.native="handleClick">按鈕</mt-button>

<mt-popup v-model="popupVisible" position="left" modal=false>

<child> </child>

</mt-popup>

</div>

</body>

<!-- 先引入 Vue -->

<script src="https://unpkg.com/vue/dist/vue.js" rel="external nofollow" ></script>

<!-- 引入組件庫 -->

<script src="https://unpkg.com/mint-ui/lib/index.js" rel="external nofollow" ></script>

<script>

new Vue({

el: '#app',

data: {

popupVisible: false

},

methods: {

handleClick: function () {

this.popupVisible = true

}

},

components: {

child: {

template: "<h1>w3cschool</h1>"

}

}

})

</script>

</html>


嘗試一下 ?


實例演示

以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號