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

Device detect SSR support #10

Open
fuxingloh opened this issue Jun 4, 2020 · 0 comments
Open

Device detect SSR support #10

fuxingloh opened this issue Jun 4, 2020 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@fuxingloh
Copy link
Owner

Motivation

Currently SSR is done using props; ssr="{columns: 2}". Statically defining the columns for SSR is useful for SEO purpose but it is only useful for SEO. Once the view get hydrated at the client side, it is practically useless and waste of CPU cycle on server side.

Solution

The user-agent gives hint of the browser type and therefore the device type. The device type can be used to interpolate the dimension of the screen and therefore providing a custom server side render to each unique user-agent.

There is a community plugin nuxt-community/device-module which can be used as a dependency for this project.

Proposed Implementation

<vue-masonry-wall :options="{width: 300, ssr: {mobile: 2, tablet: 4, desktop: 5}}" :items="items">
  <template v-slot:default="{item}">
    ...
  </template>
</vue-masonry-wall>
@fuxingloh fuxingloh added the enhancement New feature or request label Jun 4, 2020
@fuxingloh fuxingloh added this to the v0.3.0 milestone Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant