打印/下载
Vue案例
参数
小程序案例

引入

import wmPopup from '@/components/popup'

Html

<wm-popup ref="Popup" :show="demo.show" @update:show="updateShow">
  <div>内容</div>
</wm-popup>

JavaScript

import wmPopup from '@/components/popup'

export default {
  components: {wmPopup},
  data(){
    return {
      demo:{show:false},
    }
  },
  methods:{

    /* 显示 */
    updateShow(val){
      this.demo.show = val;
    },

  },
}

属性

show {Boolean}

是否显示, 默认: false

position {String}

位置: left、right、top、bottom、center

opacity {Number}

背景透明度, 默认: 0.5

bgColor {String}

内容背景颜色, 默认: ''

bgClose {Boolean}

点击背景关闭, 默认: true

time {Number}

动画时间, 默认: 400

方法

close()

关闭

引入

{
  "usingComponents": {
    "wm-popup": "/components/popup/index"
  },
  "navigationStyle": "custom"
}

Html

<wm-popup show="demo.show" position="left">
  <view>内容</view>
</wm-popup>

JavaScript

import store from '../../store'
import create from '../../libray/store/create'

create(store,{
  data:{
    demo:{show:false},
  },

});
{{copy}}