Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to load jstree in ssr mode ? #26

Open
be-next-hotdog opened this issue Apr 16, 2018 · 4 comments
Open

How to load jstree in ssr mode ? #26

be-next-hotdog opened this issue Apr 16, 2018 · 4 comments

Comments

@be-next-hotdog
Copy link

Hello, guys,

Could you show me how to implement this lib in SSR mode ?

Grateful to your helps

@zdy1988
Copy link
Owner

zdy1988 commented Apr 17, 2018

sorry , i donot know what is SSR !!!

@be-next-hotdog
Copy link
Author

be-next-hotdog commented Apr 18, 2018

Simply server side rendering :) (ps: ID 真美)

@zdy1988
Copy link
Owner

zdy1988 commented Apr 21, 2018

原来是是服务器渲染啊 😄
这两天看了一下,好像服务器渲染和组件的支持没什么联系
你可以把需要展示的数据 用 vuex 传递到树的 data 属性应该就可以了吧
我没接触过服务器渲染,所说的不知道对不对,我觉得大概是这样的!
如果只展示部分数据,就先在服务器生成部分过去,其他的通过 async 这个方法加载

@be-next-hotdog
Copy link
Author

be-next-hotdog commented Apr 24, 2018

事实上的确和组件支持本身没太多关系,但在加载第三方plugin(比如你项目中的jstreee)用于生成目标组件时 render 过程中会有问题,要判断render的环境是server还是browser之类的。你有空可以看一下这个proj https://github.com/surmon-china/vue-quill-editor 对SSR 做了特别改动支持。
很抱歉,最近很忙,否则我就自己做了交PR了
改装后可以用
https://github.com/doabit/vue-ssr-starter-kit
或者
https://github.com/devCrossNet/vue-starter
这两个SSR starter boilerplate 在非主加载模块中调用一个router 异步加载的模块看是否能稳定支持SSR。
我也是Angular / React 转来试用 Vue 做项目的,说错了什么指正我。😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants