⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.45
Server IP:
185.238.29.86
Server:
Linux server2 6.8.12-6-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-6 (2024-12-19T19:05Z) x86_64
Server Software:
nginx/1.18.0
PHP Version:
8.1.31
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
var
/
www
/
invoice
/
resources
/
js
/
components
/
Edit File: Checkbox.vue
<template> <div class="custom-control custom-checkbox d-flex"> <input :id="id || name" :name="name" :checked="internalValue" type="checkbox" class="custom-control-input" @click="handleClick" /> <label :for="id || name" class="custom-control-label my-auto"> <slot /> </label> </div> </template> <script> export default { name: 'Checkbox', props: { id: { type: String, default: null }, name: { type: String, default: 'checkbox' }, value: { type: Boolean, default: false }, checked: { type: Boolean, default: false }, }, data: () => ({ internalValue: false, }), watch: { value(val) { this.internalValue = val }, checked(val) { this.internalValue = val }, internalValue(val, oldVal) { if (val !== oldVal) { this.$emit('input', val) } }, }, created() { this.internalValue = this.value if ('checked' in this.$options.propsData) { this.internalValue = this.checked } }, methods: { handleClick(e) { this.$emit('click', e) if (!e.isPropagationStopped) { this.internalValue = e.target.checked } }, }, } </script>
Simpan