npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@team-decorate/select-tiles

v1.0.12

Published

tile checkbox and radiobutton

Downloads

15

Readme

npm-package-base

Manual Installation Through Package Managers

npm package managers

npm install @team-decorate/select-tiles

Usage

Plugin install:

import Vue from 'vue'
import SelectTiles from '@team-decorate/select-tiles'

Vue.use(SelectTiles)

Or work on a Vue instance:

<select-tiles
      name="test"
      :items="items"
      v-model="selected"
      :old="[]">
      
          <template slot="label">
          <span>*</span>checkbox
        </template>
  </select-tiles>
<script>
    import SelectTiles from '@team-decorate/select-tiles'

    export default {
        data() {
            return {
                items: [
                    {id:1, value: 'test1'},
                    {id:2, value: 'test2'},
                    {id:3, value: 'test3'},
                    {id:4, value: 'test4'},
                    {id:5, value: 'test5'},
                ],
                selected: [],
            }
        },
        components: {
            SelectTiles,
        }
    }

</script>

Props

|name|type|default|description| | ---- | ---- | ---- | ---- | |name|String|---|input name| |items|Array|required: true|element list| |mode|String|'checkbox'|change input type 'checkbox' or 'radio'| |text-key|String|'value'|key for displaying text| |id-key|---|'id'|Change items id key| |value-key|---|'value'|Change items value key| |inputShow|Boolean|false|input hidden status| |old|Array|[]|initial value|

Event

|name|argument|type|description| | ---- | ---- | ---- | ---- | |@checkStatus|(status, value)|(Boolean, ~) |check status and value|

<select-tiles
    @checkStatus="getStatus" />
methods: {
 getStatus(status, value) {
     console.log(status)
     console.log(value)
 }
},

Slot

<slot name='label><span>※</span>checkbox!</slot>

or

<template slot="label">
    <span>*</span>checkbox
</template>

Change items key

<select-tiles
      name="test2"
      :items="items"
      v-model="selected2"
      value-key="name"
      text-key="name"
      :old="['test1']"
>
</select-tiles>
<script>
    export default {
        data() {
            return {
                items: [
                    {id:1, name: 'user1'},
                    {id:2, name: 'user2'},
                    {id:3, name: 'user3'},
                ],
                selected2: [],
            }
        },
    }

</script>

scss

.select-tiles {

    &__title {
    
    }
    
    &__label {
      margin-right: 10px;
    }
    //check時
    .select-tiles__input:checked + .select-tiles__btn {
      border-color: red;
      color: red;
    }
    //default時
    &__btn {
      padding: 3px 7px;
      border-radius: 5px;
      border: 1px solid #909090;
      color: #909090;
    }
}