Giter Club home page Giter Club logo

vuejs-suglify's Introduction

Slugify VueJs

A Vue component that slugify your v-model

Demo

Check Demo Here

Installation :

npm install vue-suglify

Getting Started

In your script entry point:

window.Vue = require('vue');

import VueSuglify from 'vue-suglify'

const app = new Vue({
    el: '#app',
    components: {
          VueSuglify
    },
    data: {
         title : '',
         slug : ''
    },
});

Usage

Just apply the name and the model name that you want to have the value of the slug

 <div id="app">

 <input type="text" v-model="title">

 <vue-suglify name="title" model="slug"></vue-suglify>

 </div>

 <script>
 const app = new Vue({
    el: '#app',
    components: {
          VueSuglify
    },
    data: {
         title : '',
         slug : ''
    },
});
</script>

You can also disable the input by passing the disabled attribute as boolean

 <vue-suglify name="title" model="slug" disabled="true"></vue-suglify>

Or The input class as classname attribute

<vue-suglify name="title" model="slug" classname="form-control" disabled="true"></vue-suglify>

The separator can be change by passing sep attribute by default is -

<vue-suglify name="title" model="slug" sep="--"></vue-suglify>

If You want the first letter to be UpperCase you can use lowerCase

<vue-suglify name="title" model="slug" :lowerCase="false"></vue-suglify>

For The errors you need to add is-danger class css and pass the errors attribute as boolean

<style>
    .is-danger {
        border-color:#ff3860
    }
</style>
<vue-suglify name="title" model="slug" :errors="true"></vue-suglify>

Contributing

You are more than welcome to contribute to this repo with anything you think is useful. fixes are more than welcome.

vuejs-suglify's People

Watchers

 avatar  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.