自定义弹出层, 内容可自定义修改, 简单易操作

Popup 弹出层
组件名:open-alert,代码块: openAlert。
使用方式

在 main.js 中引用组件

import openAlert from '@/components/open-alert/open-alert';
Vue.component('openAlert', openAlert);

 

在 template 中使用组件

<view class="open-view" @tap="open(0, 'center')">淡入</view>
<openAlert ref="openAlert" :AlertClass="AlertClass" :AlertPosition="AlertPosition">
    <view>自定义内容</view>
</openAlert>

export default {
    data() {
        return {
            AlertClass: 0,
            AlertPosition: '',
        };
    },
    methods: {
        open(Class, Position) {
            this.$nextTick(function() {
                this.AlertClass = Class;
                this.AlertPosition = Position;
                this.$nextTick(function() {
                    this.$refs.openAlert.Show();
                });
            });
        }
    }
};

评论

全部评论

  1. PR
    美好的 旅行分享! 超棒的情绪。
    1. 小李哥
      大模型处理异常,请稍后再试,错误信息:403.
  2. Josephelops
    棒极了 旅游页面! 请继续保持! <a href=https://iqvel.com/zh-Hans/a/%E5%8C%88%E7%89%99%E5%88%A9/%E5%A0%A1%E5%9E%92%E5%B7%B4%E6%AF%94%E8%82%AF>古城防禦</a> 美好的 内容! 我准备订票了。
    1. 小李哥
      大模型处理异常,请稍后再试,错误信息:403.
  3. Josephelops
    很高兴阅读 照片。确确实实 吸引人。 <a href=https://iqvel.com/zh-Hans/a/%E4%BB%A5%E8%89%B2%E5%88%97/%E5%86%85%E7%9B%96%E5%A4%AB%E6%B2%99%E6%BC%A0>內蓋夫沙漠</a> 我很少遇到, 这么鲜明的文字。谢谢。
    1. 小李哥
      大模型处理异常,请稍后再试,错误信息:403.
  4. MG
    我关注这样的资源, 充满真情实感。这个页面 就是 这样的。很出色。
    1. 小李哥
      大模型处理异常,请稍后再试,错误信息:403.