首页 > 其他 > 详细

Vue EasyUI 调整大小v-Resizable的坑

时间:2021-04-12 12:31:42      阅读:16      评论:0      收藏:0      [点我收藏+]

具体安装,参考

https://www.w3cschool.cn/vueeasyui/vueeasyui-p8h937nn.html

 

坑:

这样无效  v-Resizable 直接套在  LayoutPanel 标签里面

<template>
  <div>
    <Layout style="width: 700px; height: 250px">
      <LayoutPanel region="north" style="height: 50px">
        <div class="title">North Region</div>
      </LayoutPanel>
      <LayoutPanel region="south" style="height: 50px">
        <div class="title">South Region</div>
      </LayoutPanel>
      <LayoutPanel region="west" style="width: 120px">
        <div class="title">West Region</div>
      </LayoutPanel>
      <LayoutPanel region="east" style="width: 120px">
        <div class="title">East Region</div>
      </LayoutPanel>
      <LayoutPanel region="center" id="center" 
          v-Resizable="{
            resizeStart: () => resize(),
            resizing:() => resize(),
            resizeStop: () => resize()
          }">
          <div class="title">Center Region</div>
          <div class="title">Center Region</div>
      </LayoutPanel>
    </Layout>
  </div>
</template>
<script>
export default {
  methods: {
    resize () {
      console.log(111)
    }
  }
};
</script>

 

这样有效 LayoutPanel  里面在套一层 div, v-Resizable才会生效

<template>
  <div>
    <Layout style="width: 700px; height: 250px">
      <LayoutPanel region="north" style="height: 50px">
        <div class="title">North Region</div>
      </LayoutPanel>
      <LayoutPanel region="south" style="height: 50px">
        <div class="title">South Region</div>
      </LayoutPanel>
      <LayoutPanel region="west" style="width: 120px">
        <div class="title">West Region</div>
      </LayoutPanel>
      <LayoutPanel region="east" style="width: 120px">
        <div class="title">East Region</div>
      </LayoutPanel>
      <LayoutPanel region="center" id="center" >
        <div 
          v-Resizable="{
            resizeStart: () => resize(),
            resizing:() => resize(),
            resizeStop: () => resize()
          }">
          <div class="title">Center Region</div>
          <div class="title">Center Region</div>
        </div>
      </LayoutPanel>
    </Layout>
  </div>
</template>
<script>
export default {
  methods: {
    resize () {
      console.log(111)
    }
  }
};
</script>

 

Vue EasyUI 调整大小v-Resizable的坑

原文:https://www.cnblogs.com/-roc/p/14646843.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!