Skip to content

Commit

Permalink
fix: docs transition gsap plugin register lose efficacy
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr.Mao committed Jan 13, 2024
1 parent 4065a54 commit a7fcafb
Show file tree
Hide file tree
Showing 5 changed files with 276 additions and 648 deletions.
2 changes: 1 addition & 1 deletion docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export default defineConfig({
config: md => md.use(mdPlugin),
},
vite: {
plugins: [unocss()],
plugins: [unocss() as any],
ssr: { noExternal: ['naive-ui', 'gsap'] },
resolve: {
alias: [
Expand Down
8 changes: 4 additions & 4 deletions docs/guide/components/demo/transition.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts" setup>
import type { Container, Graphics as GraphicsIns, Text } from 'pixi.js'
import type { Graphics as GraphicsIns } from 'pixi.js'
import { External, PTransition } from 'vue3-pixi'
import gsap from 'gsap'
Expand All @@ -10,13 +10,13 @@ import * as PIXI from 'pixi.js'
gsap.registerPlugin(PixiPlugin)
PixiPlugin.registerPIXI(PIXI)
function onBeforeEnter(el: Text) {
function onBeforeEnter(el: GraphicsIns) {
nextTick(() => {
gsap.set(el, { pixi: { alpha: 1, scaleX: 0.25, scaleY: 0.25 } })
})
}
function onEnter(el: Container, done: () => void) {
function onEnter(el: GraphicsIns, done: () => void) {
gsap.to(el, {
duration: 1,
ease: 'elastic.inOut(2.5, 1)',
Expand All @@ -25,7 +25,7 @@ function onEnter(el: Container, done: () => void) {
pixi: { alpha: 1, scaleX: 1, scaleY: 1 },
})
}
function onLeave(el: Container, done: () => void) {
function onLeave(el: GraphicsIns, done: () => void) {
gsap.to(el, {
duration: 0.7,
pixi: { scaleX: 1, scaleY: 1, x: 350 },
Expand Down
4 changes: 2 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"gsap": "^3.11.5",
"naive-ui": "^2.34.4",
"nanoid": "^4.0.2",
"pixi.js": "^7.2.4",
"unocss": "^0.56.0",
"pixi.js": "^7.3.2",
"unocss": "^0.58.3",
"vue": "^3.3.4",
"vue3-pixi": "workspace:^"
},
Expand Down
2 changes: 2 additions & 0 deletions packages/vue3-pixi/src/renderer/renderer.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
import type { Container, DisplayObject } from 'pixi.js'

import type { Renderer as _Renderer } from 'vue-demi'
Expand All @@ -16,6 +17,7 @@ export function createRenderer(options: { prefix?: string } = {}) {
const { createElement, setText, ...nodeOps } = _nodeOps
const { prefix = 'pixi' } = options
const rendererOptions = rendererWithCapture({
// @ts-expect-error
createElement: (...args) => createElement(prefix, ...args),
setElementText: (...args) => setText(prefix, ...args),
setText: (...args) => setText(prefix, ...args),
Expand Down
Loading

1 comment on commit a7fcafb

@vercel
Copy link

@vercel vercel bot commented on a7fcafb Jan 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

vue3-pixi – ./

vue3-pixi-git-main-tuimao.vercel.app
vue3-pixi-tuimao.vercel.app
vue3-pixi.vercel.app

Please sign in to comment.