chore(lint): switched to a better lint config
This commit is contained in:
1 parent
4d2b037dbe
commit
33c9b6643f
178 files changed
+4105
-3371
No files matched your search
@@ -1,31 +1,18 @@
|
||||
<template>
|
||||
<component
|
||||
:is="tag"
|
||||
:href="href ?? to"
|
||||
class="c-button"
|
||||
:class="{ disabled, round, circle }"
|
||||
:to="to"
|
||||
@click="handleClick"
|
||||
>
|
||||
<slot />
|
||||
</component>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { RouteLocationRaw } from 'vue-router';
|
||||
import { useTheme } from './c-button.theme';
|
||||
import { useAppTheme } from '../theme/themes';
|
||||
import { useTheme } from './c-button.theme';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
type?: 'default' | 'primary' | 'warning' | 'error';
|
||||
variant?: 'basic' | 'text';
|
||||
disabled?: boolean;
|
||||
round?: boolean;
|
||||
circle?: boolean;
|
||||
href?: string;
|
||||
to?: RouteLocationRaw;
|
||||
size?: 'small' | 'medium' | 'large';
|
||||
type?: 'default' | 'primary' | 'warning' | 'error'
|
||||
variant?: 'basic' | 'text'
|
||||
disabled?: boolean
|
||||
round?: boolean
|
||||
circle?: boolean
|
||||
href?: string
|
||||
to?: RouteLocationRaw
|
||||
size?: 'small' | 'medium' | 'large'
|
||||
}>(),
|
||||
{
|
||||
type: 'default',
|
||||
@@ -38,10 +25,10 @@ const props = withDefaults(
|
||||
size: 'medium',
|
||||
},
|
||||
);
|
||||
const { variant, disabled, round, circle, href, type, to, size: sizeName } = toRefs(props);
|
||||
|
||||
const emits = defineEmits(['click']);
|
||||
|
||||
const { variant, disabled, round, circle, href, type, to, size: sizeName } = toRefs(props);
|
||||
|
||||
function handleClick(event: MouseEvent) {
|
||||
if (!disabled.value) {
|
||||
emits('click', event);
|
||||
@@ -64,6 +51,19 @@ const appTheme = useAppTheme();
|
||||
const size = computed(() => theme.value.size[sizeName.value]);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<component
|
||||
:is="tag"
|
||||
:href="href ?? to"
|
||||
class="c-button"
|
||||
:class="{ disabled, round, circle }"
|
||||
:to="to"
|
||||
@click="handleClick"
|
||||
>
|
||||
<slot />
|
||||
</component>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.c-button {
|
||||
line-height: 1;
|
||||
|
||||
Reference in new issue
Block a user