uni-app弹出层,弹窗层 电脑版发表于:2022/3/10 11:31 **最简单的弹出一句话:** 需要什么东西在内容里边加就行了 ``` <template> <view> <uni-popup ref="popup" background-color="#fff" > 士大夫大师傅 </uni-popup> <button type="default" @click="openView()">点击</button> </view> </template> <script> export default { data() { return { } }, methods: { openView() { this.$refs.popup.open(); } } } </script> <style> </style> ``` **弹出中加两个按钮:** ``` <template> <view> <uni-popup ref="popup" background-color="#fff" > <view class="popup-content" :class="{ 'popup-height': type === 'left' || type === 'right' }"> <button class="button popup-success" @click="toAddNoteHtml()"><text class="button-text success-text">html编辑器(app上推荐使用)</text></button> <button style="margin-top: 10px;" class="button popup-error" @click="toAddNoteMarkdown()"><text class="button-text error-text">markdown编辑器(临时简版)</text></button> </view> </uni-popup> <button type="default" @click="openView()">点击</button> </view> </template> <script> export default { data() { return { } }, methods: { openView() { this.$refs.popup.open(); } } } </script> <style> </style> ```