wujie icon indicating copy to clipboard operation
wujie copied to clipboard

nuxt如何集成wujie

Open PeterPanY opened this issue 3 years ago • 7 comments

如题,在nuxt中如何集成wujie呢?nuxt作为主应用、nuxt作为子应用?

PeterPanY avatar Dec 01 '22 09:12 PeterPanY

无界目前不支持服务端渲染

ErKeLost avatar Jan 11 '23 08:01 ErKeLost

对于 next 试试: https://blog.bitsrc.io/using-non-ssr-friendly-components-with-next-js-916f38e8992c

对于 nuxt 试试:https://nuxtjs.org/docs/features/nuxt-components#the-client-only-component

yiludege avatar Jan 11 '23 10:01 yiludege

@yiludege nextjs主应用,在客户端组件中,引入WujieReact报错:

error - node_modules\.pnpm\[email protected][email protected]\node_modules\wujie-react\lib\index.js (2:259) @ eval
error - ReferenceError: self is not defined
    at __webpack_require__ (D:\GitRepo\nextjs-app\.next\server\webpack-runtime.js:33:42)
    at eval (./src/app/generate/page.tsx:7:69)
    at Object.(sc_client)/./src/app/generate/page.tsx (D:\GitRepo\nextjs-app\.next\server\app\generate\page.js:1604:1)
    at __webpack_require__ (D:\GitRepo\nextjs-app\.next\server\webpack-runtime.js:33:42)

代码如下:

'use client'

import WujieReact from 'wujie-react'

// const { bus, setupApp, preloadApp, destroyApp } = WujieReact

export default function Page() {
  return (
    <>
      <WujieReact
        width="100%"
        height="100%"
        name="xxx"
        url={'//localhost:5173'}
        sync={true}
        // fetch={fetch}
        // props={props}
        // beforeLoad={beforeLoad}
        // beforeMount={beforeMount}
        // afterMount={afterMount}
        // beforeUnmount={beforeUnmount}
        // afterUnmount={afterUnmount}
      ></WujieReact>
    </>
  )
}

gyhyfj avatar Mar 17 '23 03:03 gyhyfj

jsp支持吗?

sky124380729 avatar Nov 22 '23 11:11 sky124380729

请问目前wujie支持集成到nuxt中了吗

无界没有支持,但nuxt写一个客户端组件就可以了,就是路由的处理有点烧脑。总之就是不推荐,甚至不如iframe

gyhyfj avatar Feb 28 '24 12:02 gyhyfj

请问目前wujie支持集成到nuxt中了吗

无界没有支持,但nuxt写一个客户端组件就可以了,就是路由的处理有点烧脑。总之就是不推荐,甚至不如iframe

请问是指将wujie的组件包在clientOnly组件里吗? image image

还需要处理js代码的引用,只要最终不报错就ok

gyhyfj avatar Mar 01 '24 03:03 gyhyfj

@yiludegeIn the nextjs main application, in the client component, the WujieReact error is introduced:

error - node_modules\.pnpm\[email protected][email protected]\node_modules\wujie-react\lib\index.js (2:259) @ eval
error - ReferenceError: self is not defined
    at __webpack_require__ (D:\GitRepo\nextjs-app\.next\server\webpack-runtime.js:33:42)
    at eval (./src/app/generate/page.tsx:7:69)
    at Object.(sc_client)/./src/app/generate/page.tsx (D:\GitRepo\nextjs-app\.next\server\app\generate\page.js:1604:1)
    at __webpack_require__ (D:\GitRepo\nextjs-app\.next\server\webpack-runtime.js:33:42)

The code is as follows:

'use client'

import WujieReact from 'wujie-react'

// const { bus, setupApp, preloadApp, destroyApp } = WujieReact

export default function Page() {
  return (
    <>
      <WujieReact
        width="100%"
        height="100%"
        name="xxx"
        url={'//localhost:5173'}
        sync={true}
        // fetch={fetch}
        // props={props}
        // beforeLoad={beforeLoad}
        // beforeMount={beforeMount}
        // afterMount={afterMount}
        // beforeUnmount={beforeUnmount}
        // afterUnmount={afterUnmount}
      ></WujieReact>
    </>
  )
}

I have same problem how can I fix that ?

burakakca avatar Aug 20 '24 08:08 burakakca