* chore: update deps * feat: use jsonc/x language * chore: update eslint 10.0 * fix: no-useless-assignment * feat: add CLAUDE.md * chore: ignore * feat: claude * fix: lint * chore: suppot eslint v10 * fix: lint * fix: lint * fix: type check * fix: unit test * fix: Suggested fix * fix: unit test * chore: update stylelint v17 * chore: update all major deps * fix: echarts console warn * chore: update vitest v4 * feat: add skills ignores * chore: update deps * chore: update deps * fix: cspell * chore: update deps * chore: update tailwindcss v4 * chore: remove postcss config * fix: no use catalog * chore: tailwind v4 config * fix: tailwindcss v4 sort * feat: use eslint-plugin-better-tailwindcss * fix: Interference between enforce-consistent-line-wrapping, jsx-curly-brace-presence and Prettier * fix: Interference between enforce-consistent-line-wrapping, jsx-curly-brace-presence and Prettier * fix(lint): resolve prettier and better-tailwindcss formatting conflicts * fix(tailwind): update theme references and lint sources * style(format): normalize apps docs and playground vue files * style(format): normalize core ui-kit components * style(format): normalize effects ui and layout components
116 lines
3.3 KiB
Vue
116 lines
3.3 KiB
Vue
<script lang="ts" setup>
|
|
import { ref } from 'vue';
|
|
|
|
import { Page } from '@vben/common-ui';
|
|
|
|
import {
|
|
ElButton,
|
|
ElCard,
|
|
ElMessage,
|
|
ElNotification,
|
|
ElSegmented,
|
|
ElSpace,
|
|
ElTable,
|
|
} from 'element-plus';
|
|
|
|
type NotificationType = 'error' | 'info' | 'success' | 'warning';
|
|
|
|
function info() {
|
|
ElMessage.info('How many roads must a man walk down');
|
|
}
|
|
|
|
function error() {
|
|
ElMessage.error({
|
|
duration: 2500,
|
|
message: 'Once upon a time you dressed so fine',
|
|
});
|
|
}
|
|
|
|
function warning() {
|
|
ElMessage.warning('How many roads must a man walk down');
|
|
}
|
|
function success() {
|
|
ElMessage.success(
|
|
'Cause you walked hand in hand With another man in my place',
|
|
);
|
|
}
|
|
|
|
function notify(type: NotificationType) {
|
|
ElNotification({
|
|
duration: 2500,
|
|
message: '说点啥呢',
|
|
type,
|
|
});
|
|
}
|
|
const tableData = [
|
|
{ prop1: '1', prop2: 'A' },
|
|
{ prop1: '2', prop2: 'B' },
|
|
{ prop1: '3', prop2: 'C' },
|
|
{ prop1: '4', prop2: 'D' },
|
|
{ prop1: '5', prop2: 'E' },
|
|
{ prop1: '6', prop2: 'F' },
|
|
];
|
|
|
|
const segmentedValue = ref('Mon');
|
|
|
|
const segmentedOptions = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
|
|
</script>
|
|
|
|
<template>
|
|
<Page
|
|
description="支持多语言,主题功能集成切换等"
|
|
title="Element Plus组件使用演示"
|
|
>
|
|
<div class="flex flex-wrap gap-5">
|
|
<ElCard class="mb-5 w-auto">
|
|
<template #header> 按钮 </template>
|
|
<ElSpace>
|
|
<ElButton text>Text</ElButton>
|
|
<ElButton>Default</ElButton>
|
|
<ElButton type="primary"> Primary </ElButton>
|
|
<ElButton type="info"> Info </ElButton>
|
|
<ElButton type="success"> Success </ElButton>
|
|
<ElButton type="warning"> Warning </ElButton>
|
|
<ElButton type="danger"> Error </ElButton>
|
|
</ElSpace>
|
|
</ElCard>
|
|
<ElCard class="mb-5 w-80">
|
|
<template #header> Message </template>
|
|
<ElSpace>
|
|
<ElButton type="info" @click="info"> 信息 </ElButton>
|
|
<ElButton type="danger" @click="error"> 错误 </ElButton>
|
|
<ElButton type="warning" @click="warning"> 警告 </ElButton>
|
|
<ElButton type="success" @click="success"> 成功 </ElButton>
|
|
</ElSpace>
|
|
</ElCard>
|
|
<ElCard class="mb-5 w-80">
|
|
<template #header> Notification </template>
|
|
<ElSpace>
|
|
<ElButton type="info" @click="notify('info')"> 信息 </ElButton>
|
|
<ElButton type="danger" @click="notify('error')"> 错误 </ElButton>
|
|
<ElButton type="warning" @click="notify('warning')"> 警告 </ElButton>
|
|
<ElButton type="success" @click="notify('success')"> 成功 </ElButton>
|
|
</ElSpace>
|
|
</ElCard>
|
|
<ElCard class="mb-5 w-auto">
|
|
<template #header> Segmented </template>
|
|
<ElSegmented
|
|
v-model="segmentedValue"
|
|
:options="segmentedOptions"
|
|
size="large"
|
|
/>
|
|
</ElCard>
|
|
<ElCard class="mb-5 w-80">
|
|
<template #header> V-Loading </template>
|
|
<div class="flex-center size-72" v-loading="true">一些演示的内容</div>
|
|
</ElCard>
|
|
<ElCard class="mb-5 w-80">
|
|
<ElTable :data="tableData" stripe>
|
|
<ElTable.TableColumn label="测试列1" prop="prop1" />
|
|
<ElTable.TableColumn label="测试列2" prop="prop2" />
|
|
</ElTable>
|
|
</ElCard>
|
|
</div>
|
|
</Page>
|
|
</template>
|