feat: create randomId helper and use everywhere
Co-authored-by: konrad <konrad@kola-entertainments.de>
This commit is contained in:
@ -28,6 +28,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {createRandomID} from '@/helpers/randomId'
|
||||
|
||||
const DEFAULT_COLORS = [
|
||||
'#1973ff',
|
||||
'#7F23FF',
|
||||
@ -37,11 +39,6 @@ const DEFAULT_COLORS = [
|
||||
'#00db60',
|
||||
]
|
||||
|
||||
function createRandomID() {
|
||||
const ID_LENGTH = 9
|
||||
return Math.random().toString(36).substr(2, ID_LENGTH)
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'colorPicker',
|
||||
data() {
|
||||
|
@ -21,12 +21,14 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {createRandomID} from '@/helpers/randomId'
|
||||
|
||||
export default {
|
||||
name: 'fancycheckbox',
|
||||
data() {
|
||||
return {
|
||||
checked: false,
|
||||
checkBoxId: 'fancycheckbox' + Math.random(),
|
||||
checkBoxId: `fancycheckbox_${createRandomID()}`,
|
||||
}
|
||||
},
|
||||
props: {
|
||||
|
Reference in New Issue
Block a user