亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

Vue-drag-resize 拖拽縮放插件的使用(簡單示例)

 更新時間:2019年12月04日 09:55:01   作者:是我啊i  
本文通過代碼給大家介紹了Vue-drag-resize 拖拽縮放插件使用簡單示例,代碼簡單易懂,非常不錯,具有一定的參考借鑒價值,需要的朋友可以參考下

字幕

<div id="lBox" style="background-color: #D7E9F5;"
     :style="{'height': parentHeight + 'px', 'width': parentWidth + 'px'}">
     
 <drag-resize v-for="(rect,index) in texts"
       style="overflow: hidden;"
       :w="rect.BoxWidth"
       :h="rect.BoxHeight"
       :x="rect.BoxLeft"
       :y="rect.BoxTop"
       @resizing="textResize($event, index)" 
       @dragging="textResize($event, index)">
       
 <div style="width: 100%; height: 100%;"
 :style={backgroundColor:rect.BoxColor,opacity:rect.BoxOpacity}>
 </div><!-- 控制背景色及背景透明度 使背景透明度不影響字幕 -->
    
 <div style="width: 100%; height: 100%;">
    <p :class="rect.Direction === 'Left to Right' ? 'roll-right' : 'roll-left'"
      style="width: 100%; position:absolute; bottom:-0.25em;left:0px"
      :style="{color: rect.TextColor,fontFamily: rect.FontFile,
     fontSize: rect.FontSize+'px',
     opacity:rect.FontOpacity,
     animationDuration: rect.Speed + 's'}">
     {{rect.Text}}
    </p>
 </div>
 
 </drag-resize>

logo

 <drag-resize v-for="(rect,index) in logos"
      :parentLimitation="true"
      :w="rect.Width"
      :h="rect.Height"
      :x="rect.Left"
      :y="rect.Top"
      @resizing="logoResize($event, index)" 
      @dragging="logoResize($event, index)">
       
    <div style="width: 100%;height: 100%;">
     <img :src="'/logos/' + rect.FileName"
      style="width: 100%;height: 100%;">
    </div>
    
 </drag-resize>
</div>

JS

textResize(newRect, index) {
  const BoxWidth = newRect.width+''
  this.texts[index].BoxWidth = BoxWidth.substring(0, BoxWidth.indexOf("."))

  const BoxHeight = newRect.height+''
  this.texts[index].BoxHeight = BoxHeight.substring(0, BoxHeight.indexOf("."))

  const BoxTop = newRect.top+''
  this.texts[index].BoxTop = BoxTop.substring(0, BoxTop.indexOf("."))

  const BoxLeft = newRect.left+''
  this.texts[index].BoxLeft = BoxLeft.substring(0, BoxLeft.indexOf("."))
 }

 logoResize(newRect, index) {
  const Width = newRect.width''
  this.logos[index].Width = Width.substring(0, Size.indexOf("."))
  
  const Height = newRect.height+''
  this.logos[index].Height = Height .substring(0, Size.indexOf("."))
  
  const Top = newRect.top+''
  this.logos[index].Top = Top.substring(0, Top.indexOf("."))

  const Left = newRect.left+''
  this.logos[index].Left = Left.substring(0, Left.indexOf("."))
 }

除此之外還有字幕向左或向右滾動的CSS

 .roll-left {
 animation: wordsLoopLeft 6s linear infinite normal;
 }

 .roll-right {
 animation: wordsLoopRight 6s linear infinite normal;
 }

 @keyframes wordsLoopLeft {
 0% {
  transform: translateX(100%);
  -webkit-transform: translateX(100%);
 }
 100% {
  transform: translateX(-40%);
  -webkit-transform: translateX(-40%);
 }
 }

 @keyframes wordsLoopRight {
 0% {
  transform: translateX(-40%);
  -webkit-transform: translateX(-40%);
 }
 100% {
  transform: translateX(100%);
  -webkit-transform: translateX(100%);
 }
 }

And:

自定義字體在

CSS @font-face 自定義字體

總結(jié)

以上所述是小編給大家介紹的Vue-drag-resize 拖拽縮放插件的使用,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!
如果你覺得本文對你有幫助,歡迎轉(zhuǎn)載,煩請注明出處,謝謝!

相關(guān)文章

  • Vue3中Watch、Watcheffect、Computed的使用和區(qū)別解析

    Vue3中Watch、Watcheffect、Computed的使用和區(qū)別解析

    Watch、Watcheffect、Computed各有優(yōu)劣,選擇使用哪種方法取決于應(yīng)用場景和需求,watch?適合副作用操作,watchEffect適合簡單的自動副作用管理,computed?適合聲明式的派生狀態(tài)計算,本文通過場景分析Vue3中Watch、Watcheffect、Computed的使用和區(qū)別,感興趣的朋友一起看看吧
    2024-07-07
  • vue動態(tài)代理無須重啟項目解決方案詳解

    vue動態(tài)代理無須重啟項目解決方案詳解

    這篇文章主要為大家介紹了vue動態(tài)代理無須重啟項目解決方案詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2022-09-09
  • vue jsx 使用指南及vue.js 使用jsx語法的方法

    vue jsx 使用指南及vue.js 使用jsx語法的方法

    這篇文章主要介紹了vue jsx 使用指南及vue.js 使用jsx語法的方法,非常不錯,具有參考借鑒價值,需要的朋友可以參考下
    2017-11-11
  • vue中重定向redirect:‘/index‘,不顯示問題、跳轉(zhuǎn)出錯的完美解決

    vue中重定向redirect:‘/index‘,不顯示問題、跳轉(zhuǎn)出錯的完美解決

    這篇文章主要介紹了vue中重定向redirect:‘/index‘,不顯示問題、跳轉(zhuǎn)出錯的完美解決方案,本文通過圖文并茂的形式給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友參考下吧
    2020-09-09
  • vue中音頻wavesurfer.js的使用方法

    vue中音頻wavesurfer.js的使用方法

    這篇文章主要為大家詳細(xì)介紹了vue中音頻wavesurfer.js的使用方法,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2020-02-02
  • 關(guān)于vue的語法規(guī)則檢測報錯問題的解決

    關(guān)于vue的語法規(guī)則檢測報錯問題的解決

    在配置路有的時候,陸續(xù)出現(xiàn)了各種報錯其中最多的是一些寫法,例如空格,縮進(jìn),各種括號,這篇文章主要介紹了關(guān)于vue的語法規(guī)則檢測報錯問題的解決,非常具有實用價值,需要的朋友可以參考下
    2018-05-05
  • Vue實現(xiàn)動態(tài)控制表格列的顯示和隱藏

    Vue實現(xiàn)動態(tài)控制表格列的顯示和隱藏

    這篇文章主要為大家詳細(xì)介紹了Vue實現(xiàn)動態(tài)控制表格列的顯示和隱藏,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2022-04-04
  • Vue2響應(yīng)式系統(tǒng)介紹

    Vue2響應(yīng)式系統(tǒng)介紹

    這篇文章主要介紹了Vue2響應(yīng)式系統(tǒng),響應(yīng)式系統(tǒng)主要實現(xiàn)某個依賴了數(shù)據(jù)的函數(shù),當(dāng)所依賴的數(shù)據(jù)改變的時候,該函數(shù)要重新執(zhí)行,下文更多相關(guān)介紹需要的小伙伴可以參考一下
    2022-04-04
  • vue基礎(chǔ)之v-bind屬性、class和style用法分析

    vue基礎(chǔ)之v-bind屬性、class和style用法分析

    這篇文章主要介紹了vue基礎(chǔ)之v-bind屬性、class和style用法,結(jié)合實例形式分析了vue.js中v-bind綁定及class、style樣式控制相關(guān)操作技巧,需要的朋友可以參考下
    2019-03-03
  • Vue.js實現(xiàn)備忘錄功能

    Vue.js實現(xiàn)備忘錄功能

    這篇文章主要為大家詳細(xì)介紹了Vue.js實現(xiàn)備忘錄功能,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2019-06-06

最新評論