# 开发弹出提示框
复制模块uni-popup到components中并引入使用
<template>
<!-- 弹出公告 -->
<uni-popup :show="showPopup" position="middle" mode="fixed" @hidePopup="hidePopup">
<view class="gonggao">
<view class="u-f-ajc">
<image src="../../static/common/addinput.png" mode="widthFix"></image>
</view>
<view>1.涉及黄色,政治,广告及骚扰信息</view>
<view>2.涉及黄色,政治,广告及骚扰信息</view>
<view>3.涉及黄色,政治,广告及骚扰信息</view>
<view>4.涉及黄色,政治,广告及骚扰信息</view>
<button type="default" @tap="hidePopup">朕知道了</button>
</view>
</uni-popup>
</template>
<script>
import uniPopup from '../../components/uni-popup/uni-popup.vue'
export default {
components: {
uniPopup
},
data() {
return {
// 弹出层
showPopup:true
};
},
// 弹出提示
hidePopup() {
this.showPopup = false
}
</script>
<style>
/* 弹出层 */
.gonggao {
width: 500rpx;
image {
width: 75%;
margin-bottom: 20rpx;
}
button {
margin-top: 20rpx;
background-color: #ffe934;
color: #171606;
}
}
</style>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49