2.1.4 • Published 11 months ago

@dominate-color-js/vue v2.1.4

Weekly downloads
-
License
-
Repository
github
Last release
11 months ago

Installation

npm install @dominate-color-js/vue
yarn add @dominate-color-js/vue
pnpm add @dominate-color-js/vue

Basic Example

<template>
    <div>
      <input type="file" @change="handleFileInput" />
      <ul>
        <li v-for="(color, index) in colors" :key="index">{{ color }}</li>
      </ul>
      <div v-if="loading">Loading...</div>
      <div v-if="error">{{ error.message }}</div>
    </div>
</template>

<script lang="ts">
   import { useColorDetection } from '@dominate-color-js/vue';

   export default {  
        setup() { 
            const { handler, colors, loading, error } = useColorDetection();

            const handleFileInput = (event: any) => {
                const file = event.target.files[0];
                handler(file);
            };

            return { colors, loading, error, handleFileInput };
            }   
        }
</script>

a more detailed version

2.1.4

11 months ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago