MCPcopy Create free account
hub / github.com/egoist/vue-client-only

github.com/egoist/vue-client-only @v2.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.1.0 ↗ · + Follow
2 symbols 7 edges 5 files 0 documented · 0% updated 3y agov2.1.0 · 2021-06-03★ 4659 open issues

Browse by type

Functions 1 Types & classes 1
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

vue-client-only

NPM version NPM downloads CircleCI donate

Install

yarn add vue-client-only

This project is previously known as vue-no-ssr, switch to 1.x branch for the old docs.

Usage

<template>



    <h1>My Website</h1>
    <client-only>

      <comments />
    </client-only>



</template>

<script>
  import ClientOnly from 'vue-client-only'

  export default {
    components: {
      ClientOnly
    }
  }
</script>

Placeholder

Use a slot or text as placeholder until <client-only /> is mounted on client-side.

eg, show a loading indicator.

<template>



    <h1>My Website</h1>

    <client-only>
      <comments />
      <comments-placeholder slot="placeholder" />
    </client-only>

    <client-only placeholder="Loading...">
      <comments />
    </client-only>



</template>

<script>
  import ClientOnly from 'vue-client-only'

  export default {
    components: {
      ClientOnly
    }
  }
</script>

By default the placeholder will be wrapped in a div tag, however you can use placeholderTag prop to customize it:

<client-only placeholder="loading" placeholder-tag="span">
  <comments />
</client-only>

And you get:

<span class="client-only-placeholder">
  loading
</span>

If prop placeholder is an empty string (or null) and no placeholder slot is found, then <client-only> will render the Vue placeholder element ` instead of rendering theplacholder-tag` during SSR render.

Development

yarn install

# Run example
yarn example

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

vue-client-only © egoist, Released under the MIT License.

Authored and maintained by egoist with help from contributors (list).

egoist.moe · GitHub @egoist · Twitter @_egoistlily

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Function 1
Interface 1

Languages

TypeScript100%

Modules by API surface

types/index.d.ts1 symbols
src/index.js1 symbols

For agents

$ claude mcp add vue-client-only \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page