Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@happyjayxin/ubutton

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@happyjayxin/ubutton

My simple Button.

latest
Source
npmnpm
Version
0.3.0
Version published
Maintainers
1
Created
Source

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.

Keywords

button

FAQs

Package last updated on 27 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts