Git Product home page Git Product logo

vue3-dummy's Introduction

vue3-dummy

Placeholder Images and Dummy Text for Vue3

vue3-dummy is a wrapper around the https://dummyjs.com/ library to expose placeholder Images and Dummy, Lorum Ipsum Text as a vue directive

Really hard work belongs to Paul Collett with original repository :https://github.com/paulcollett/vue-dummy

Usage

Add to your HTML page:

<script src="https://unpkg.com/vue"></script>
<script src="https://unpkg.com/vue3-dummy"></script>

or, import into your module npm install vue3-dummy --save-dev

import Vue from "vue"
import Vue3Dummy from "vue3-dummy"
CreateApp({}).use(Vue3Dummy).mount('#app')

Dummy Text

<p v-dummy></p>

Choose the number of words:

<p v-dummy="150"></p>

Choose random amount of words between 3 & 10:

<p v-dummy="'3,10'"></p> <!-- Note: the quotes to pass the expression as a string -->
<p v-dummy:3,10></p> <!-- or, as a Vue argument-->

As a component:

<dummy></dummy>
<dummy text="30"></dummy>
<dummy t="1,3"></dummy>

Dummy Images

<img v-dummy="300" />
<img v-dummy="'400x300'" /> <!-- Note: the quotes to pass the expression as a string -->
<img v-dummy:400x300 /><!-- or, as a Vue argument -->
<img v-dummy.400x300 /><!-- or, as a Vue modifier -->

Use width & height attribues or, size with CSS

<img v-dummy width="150" height="150" />

Defaults to the size of the parent container

<img v-dummy />

Create random sized images. Useful for testing dimentions of unknown sized user uploaded images

<img v-dummy="'100,400x200,400'" /> <!-- Note: the quotes to pass the expression as a string -->
<img v-dummy:100,400x200,400 /> <!-- or, as a Vue argument (or modifier) -->

As a component:

<dummy img></dummy>
<dummy img="400x300"></dummy>
<dummy i="100"></dummy>

Special Elements

Using v-dummy on some tags will result in some placeholder content with expected markup. This is useful in some cases like quick styling of elements

<ol v-dummy></ol> <!-- outputs a small list -->
<ul v-dummy></ul> <!-- outputs a small list -->
<table v-dummy></table> <!-- outputs a small table -->

Example Repeat Elements

Combine with v-for to repeat elements

  <ul>
    <li v-for="i in 6" v-dummy>#{{i}}: </li>
  </ul>

vue3-dummy's People

Contributors

retrocib avatar

Watchers

 avatar

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.