tnblog
首页
视频
资源
登录

uni-app弹出层,弹窗层

7353人阅读 2022/3/10 11:31 总访问:892057 评论:0 收藏:0 手机
分类: 移动开发

最简单的弹出一句话:
需要什么东西在内容里边加就行了

  1. <template>
  2. <view>
  3. <uni-popup ref="popup" background-color="#fff" >
  4. 士大夫大师傅
  5. </uni-popup>
  6. <button type="default" @click="openView()">点击</button>
  7. </view>
  8. </template>
  9. <script>
  10. export default {
  11. data() {
  12. return {
  13. }
  14. },
  15. methods: {
  16. openView()
  17. {
  18. this.$refs.popup.open();
  19. }
  20. }
  21. }
  22. </script>
  23. <style>
  24. </style>

弹出中加两个按钮:

  1. <template>
  2. <view>
  3. <uni-popup ref="popup" background-color="#fff" >
  4. <view class="popup-content" :class="{ 'popup-height': type === 'left' || type === 'right' }">
  5. <button class="button popup-success" @click="toAddNoteHtml()"><text
  6. class="button-text success-text">html编辑器(app上推荐使用)</text></button>
  7. <button style="margin-top: 10px;" class="button popup-error" @click="toAddNoteMarkdown()"><text
  8. class="button-text error-text">markdown编辑器(临时简版)</text></button>
  9. </view>
  10. </uni-popup>
  11. <button type="default" @click="openView()">点击</button>
  12. </view>
  13. </template>
  14. <script>
  15. export default {
  16. data() {
  17. return {
  18. }
  19. },
  20. methods: {
  21. openView()
  22. {
  23. this.$refs.popup.open();
  24. }
  25. }
  26. }
  27. </script>
  28. <style>
  29. </style>

欢迎加群讨论技术,1群:677373950(满了,可以加,但通过不了),2群:656732739。有需要软件开发,或者学习软件技术的朋友可以和我联系~(Q:815170684)

评价
这一生多幸运赶上过你.
排名
8
文章
243
粉丝
7
评论
7
ICP备案 :渝ICP备18016597号-1
网站信息:2018-2025TNBLOG.NET
技术交流:群号656732739
联系我们:contact@tnblog.net
公网安备:50010702506256
欢迎加群交流技术