Coder Social home page Coder Social logo

Comments (7)

yyx990803 avatar yyx990803 commented on August 15, 2024

Why do you render the list from the server in the first place though? Why not just render JSON?
If you have no control over what the server renders, then I think this is the only way to do it.

BTW, please only submit documentation-related issues here. General questions should be posted here: https://github.com/vuejs/Discussion/issues

from v2.vuejs.org.

flo-sch avatar flo-sch commented on August 15, 2024

Aps, sorry yeah, didn't notice I was not on the good place. Possible to move it ?!

You would suggest to render a JSON object in a <script></script> directly, in order to pass data to JS ?
I just dislike this way, I personally find it hacky too...
And I don't really want to build an asynchronous stuff, at this step.

from v2.vuejs.org.

yyx990803 avatar yyx990803 commented on August 15, 2024

I don't think rendering to JSON is dirty, it's more like embedding JSON data in your HTML so that it can be sent down to the client within a single request, and is in fact cleaner than initializing data in the vue template.

from v2.vuejs.org.

flo-sch avatar flo-sch commented on August 15, 2024

Okay, thanks for your feedback :)
I guess we can close the issue, at this point!

from v2.vuejs.org.

azamat-sharapov avatar azamat-sharapov commented on August 15, 2024

It's era of rendering things on client side, mate :) I also recommend not doing almost any kind of rendering on server side.

from v2.vuejs.org.

flo-sch avatar flo-sch commented on August 15, 2024

Not sure to get what you mean by server-side rendering?
I just do not especially like to expose JSON data globally on client-side, but nvm, I just remove this exposition once the Vue parsed it.

from v2.vuejs.org.

azamat-sharapov avatar azamat-sharapov commented on August 15, 2024

I meant rendering HTML on server side, but just return data like JSON. But yeah, it's everybody's preference.

from v2.vuejs.org.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.