第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

這是在 vue.js 中導(dǎo)入 gsap 的正確方法嗎(它可以工作,但這是“正確”的方法嗎?)

這是在 vue.js 中導(dǎo)入 gsap 的正確方法嗎(它可以工作,但這是“正確”的方法嗎?)

catspeake 2023-08-10 11:03:10
我對(duì) Vue.js 還很陌生,在讓庫(kù)正常工作時(shí)遇到了一些問(wèn)題,但沒(méi)有收到“錯(cuò)誤‘X’未定義 no-undef”消息。在這種情況下,未定義“Back”(它是 GSAP 的一部分),我認(rèn)為“定義”Back 的唯一位置是導(dǎo)入中。這只是導(dǎo)入庫(kù)的方法嗎?我是否必須像這樣編寫(xiě)導(dǎo)入中每個(gè)未定義的部分?它有效,但似乎沒(méi)有必要。<template>  <div id="mainTemplate">    <h2>This is the MainTemplaye.vue Component</h2>    <div ref="box" class="box"></div>  </div></template><script>import { TimelineLite, Back } from "gsap";export default {  name: "MainTemplate",  mounted() {    const { box } = this.$refs;    const timeline = new TimelineLite();    timeline.to(box, 1, { x: 200, rotation: 90, ease: Back.easeInOut, })    timeline.to(box, 0.5, { background: 'green' },'-=0.5')  },};</script><style>.box {  height: 60px;  width: 60px;  background: red;}</style>
查看完整描述

1 回答

?
蝴蝶不菲

TA貢獻(xiàn)1810條經(jīng)驗(yàn) 獲得超4個(gè)贊

我不確定你從哪里學(xué)習(xí),但你使用的是 GSAP 的舊語(yǔ)法。如果您使用 GSAP 的新語(yǔ)法,則無(wú)需導(dǎo)入除gsap您的情況之外的任何內(nèi)容:


import { gsap } from "gsap";


export default {

? name: "MainTemplate",

? mounted() {

? ? const { box } = this.$refs;

? ? const timeline = gsap.timeline();


? ? timeline.to(box, { duration: 1, x: 200, rotation: 90, ease: 'back.inOut' })

? ? timeline.to(box, { background: 'green' }, '-=0.5')

? },

};

查看完整回答
反對(duì) 回復(fù) 2023-08-10
  • 1 回答
  • 0 關(guān)注
  • 210 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)