1、u-popup
只是一個彈出層,如何實現(xiàn)全看自己
參考:Popup 彈出層 | uView - 多平臺快速開發(fā)的UI框架 - uni-app UI框架
u-popup
<u-popup v-model="appear" mode="center" length="90%" :closeable="true" border-radius="20"></u-popup>
2、uni-app組件
該組件在ios小程序中無法顯示確定和取消的按鈕的文字。
uni.$showModal.dialog({
_this: this,
title: '獲取定位失敗',
content: err.errCode == 2 || err.errMsg.indexOf('fail auth deny') >
-1 ?
'請打開手機定位功能' : '請開啟地理位置授權(quán)',
confirmText: err.errCode == 2 || err.errMsg.indexOf(
'fail auth deny') > -
1 ? '好的' : '重新獲取',
cancelColor: 'black',
confirmColor: 'black',
success: (res) => {
let status = true
status = res.confirm && !err.errCode
if (status) {
uni.openSetting({
scope: 'scope.userLocation',
success: (res) => {
this.chooseLocation()
},
fail: () => {}
})
}
},
fail: () => {}
})
3、u-model
參考:Modal 模態(tài)框 | uView - 多平臺快速開發(fā)的UI框架 - uni-app UI框架
<template>
<view>
<u-modal v-model="show" :content="content"></u-modal>
<u-button @click="open">
打開模態(tài)框
</u-button>
</view>
</template>
<script>
export default {
data() {
return {
show: false,
content: '東臨碣石,以觀滄海'
}
},
methods: {
open() {
this.show = true;
}
}
}
</script>