Install with npm or yarn
npm install @todovue/tvthemebutton
yarn add @todovue/tvthemebutton
Import
import TvThemeButton from '@todovue/tvthemebutton'
You can also import it directly in the main.js file, so you don't have to import it in the pages
import { createApp } from "vue";
import App from "./App.vue";
import TvThemeButton from '@todovue/tvthemebutton'
const app = createApp(App);
app.component("TvThemeButton", TvThemeButton);
app.mount("#app");
<template>
<tv-theme-button
@change-theme="changeValue"
/>
</template>
<script setup>
import TvThemeButton from "@todovue/tvthebutton";
const changeValue = (value) => {
console.log(value); // return light or dark
};
</script>
Name | Description |
---|---|
change-theme | Return the value of the theme selected. |
Clone the repository and install the dependencies
git clone https://github.com/TODOvue/todovue-theme-button.git
cd todovue-theme-button
yarn install