0.3.0 • Published 4 years ago

@happyjayxin/ubutton v0.3.0

Weekly downloads
16
License
MIT
Repository
github
Last release
4 years ago

U-Button

Vue button with simple style.

Demo

U-Button

Install

NPM

npm install @happyjayxin/ubutton

CDN

<link
  rel="stylesheet"
  type="text/css"
  href="https://cdn.jsdelivr.net/npm/@happyjayxin/ubutton@0.3.0/dist/u-button.css"
/>
<script src="https://cdn.jsdelivr.net/npm/@happyjayxin/ubutton"></script>

Global install as a vue plugin

import Vue from 'vue';
import UButton from '@happyjayxin/ubutton';
import '@happyjayxin/ubutton/dist/u-button.css';
Vue.use(UButton);
// You can set default global options.
Vue.use(UButton, {
  theme: '#f00', // Button theme
  outline: true,
  round: '1'
});

Or import UButton as a local component

<script type="text/ecmascript-6">
  import { UButton } from "@happyjayxin/ubutton";
  import "@happyjayxin/ubutton/dist/u-button.css";

  export default {
    components: { UButton }
  };
</script>

Usage

<template>
  <div id="app">
    <u-button @click="sayHello" theme="#079992">Hello u-button</u-button>
  </div>
</template>

<script>
  export default {
    name: 'app',
    methods: {
      sayHello() {
        alert('Hello');
      }
    }
  };
</script>

See more Example Code

Using with Nuxt

Create the file ~/plugins/vue-u-button

import Vue from 'vue';
import UButton from '@happyjayxin/ubutton';
import '@happyjayxin/ubutton/dist/u-button.css';
Vue.use(UButton);

Then add the file path inside the plugins key of our nuxt.config.js

export default {
  plugins: ['~/plugins/vue-u-button']
};

Attributes

Props

屬性說明類型預設
disabled禁用按鈕。Booleanfalse
theme客製按鈕主題色,參數必須為 Hex 十六進位。String#000
href跳頁選項。String-
target打開連結方式,和 HTML a 標籤的 target 相同。String_self
loading按鈕進入載入中狀態。Booleanfalse
round按鈕邊框圓角,可選值為 0123String'0'
outline改變按鈕樣式為外框按鈕Booleanfalse

Event

名稱說明回傳
click點擊事件-

License

This software is licensed under the MIT.

0.3.0

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.9

4 years ago

0.2.2

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.3

4 years ago

0.1.0

4 years ago