vuejs 组件_vuejs的简单模式组件

vuejs 组件

副词 (vue-modaltor)

vue modal component for vuejs and hope it be useful for everyone.

vuejs的vue模态组件,希望它对每个人都有用。

特征 (Features)

  • no need to handle modal's height manually it extends as the content of modal increases .

    无需手动处理模态的高度,它会随着模态含量的增加而扩展。

  • manage modal's size on diffrent dimenstions with one single attribute see responsive

    对不同势dimenstions管理模式的大小与一个单独的属性看响应

  • scrollable modal, modal will get scroll if conntent is more than current view page height see close-scroll

    可滚动的模式,如果内容大于当前视图页面的高度,则模式将滚动, 请参见close-scroll

  • modals has multiple parent animations parent-animation

    模态具有多个父动画父动画

安装 (Installation)

npm install vue-modaltor --save
yarn add vue-modaltor

then you can import modaltor like this ...

那么您可以像这样导入调节器...

import Vue from 'vue'
import VueModalTor from 'vue-modaltor'
Vue.use(VueModalTor)

if you are not using any build system you can include it in your project

如果您不使用任何构建系统,则可以将其包含在项目中

<script src="/vue-modaltor/dist/vue-modaltor.js"></script>

(Example)

<vue-modaltor  :visible="open" @hide="hideModal">
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
      tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
      quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
      consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
      cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
      proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
  </vue-modaltor>
  <button @click="open=true">modal-basic</button>
var app = new Vue({
      el: '#app',
      data: {
          open: false
      },
      methods: {
          hideModal() {
              this.open = false
          }
      }
  })

道具配置 (Props config)

props: {
   // this is for toggle show modal 
   // :visible:false
    visible: {
      type: Boolean,
      required: false,
      default: false
    },
    // this is for responsive modal and
    // :resize-width='{1200:"50%",992:"70%",768:"90%"}'
    resizeWidth:{
      type:Object,
    },
    // this is for anaimating modal 
    // :animation-panel='modal-slide-right'
    // :animation-panel='modal-slide-left'
    // :animation-panel='modal-slide-top'
    // :animation-panel='modal-slide-bottom'
    animationPanel:{
      type: String,
      required: false,
      default: 'modal-fade'
    },
    // this is for anaimating animationParent modal 
    // :animation-parent='modal-scale'
    animationParent:{
      type: String,
      required: false,
      default: 'modal-fade'
    },
    // this is for bgcolor overlay
    bgOverlay:{
      type: String,
      required: false,
      default: '#fff'
    },
    // this is for bgcolor panel
    bgPanel:{
      type: String,
      required: false,
      default: '#fff'
    },
    //set default width modal
    // :default-width="'50%'"
    // :default-width="'495px'"
    // :default-width="'40em'"
    defaultWidth:{
      type: String,
      required: false,
      default: '50%'
    },
    // this is option for close scroll body when show modal
    // :close-scroll="false"  // if true close scroll body
    closeScroll:{
      type: Boolean,
      required: false,
      default: true
    }
  },

待办事项清单 (TODO List)

  • [ ] multiple animations on diffrent device size

    []不同设备尺寸上的多个动画

  • [ ] 3D Animations

    [] 3D动画

  • [ ]

    []

翻译自: https://vuejsexamples.com/a-simple-modal-component-for-vuejs/

vuejs 组件

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值