Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
monorepo
/
venus
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit fccbe44c
authored
Dec 04, 2024
by
Netfan
Committed by
GitHub
Dec 04, 2024
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat: v-loading support for `element plus` (#5008)
1 parent
e23486db
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
5 deletions
apps/web-ele/src/bootstrap.ts
apps/web-ele/src/views/demos/element/index.vue
apps/web-ele/src/bootstrap.ts
View file @
fccbe44
...
@@ -7,6 +7,7 @@ import '@vben/styles';
...
@@ -7,6 +7,7 @@ import '@vben/styles';
import
'@vben/styles/ele'
;
import
'@vben/styles/ele'
;
import
{
useTitle
}
from
'@vueuse/core'
;
import
{
useTitle
}
from
'@vueuse/core'
;
import
{
ElLoading
}
from
'element-plus'
;
import
{
$t
,
setupI18n
}
from
'#/locales'
;
import
{
$t
,
setupI18n
}
from
'#/locales'
;
...
@@ -19,6 +20,9 @@ async function bootstrap(namespace: string) {
...
@@ -19,6 +20,9 @@ async function bootstrap(namespace: string) {
await
initComponentAdapter
();
await
initComponentAdapter
();
const
app
=
createApp
(
App
);
const
app
=
createApp
(
App
);
// 注册Element Plus提供的v-loading指令
app
.
directive
(
'loading'
,
ElLoading
.
directive
);
// 国际化 i18n 配置
// 国际化 i18n 配置
await
setupI18n
(
app
);
await
setupI18n
(
app
);
...
...
apps/web-ele/src/views/demos/element/index.vue
View file @
fccbe44
...
@@ -61,7 +61,8 @@ const segmentedOptions = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
...
@@ -61,7 +61,8 @@ const segmentedOptions = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
description=
"支持多语言,主题功能集成切换等"
description=
"支持多语言,主题功能集成切换等"
title=
"Element Plus组件使用演示"
title=
"Element Plus组件使用演示"
>
>
<ElCard
class=
"mb-5"
>
<div
class=
"flex flex-wrap gap-5"
>
<ElCard
class=
"mb-5 w-auto"
>
<template
#
header
>
按钮
</
template
>
<template
#
header
>
按钮
</
template
>
<ElSpace>
<ElSpace>
<ElButton
text
>
Text
</ElButton>
<ElButton
text
>
Text
</ElButton>
...
@@ -73,7 +74,7 @@ const segmentedOptions = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
...
@@ -73,7 +74,7 @@ const segmentedOptions = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
<ElButton
type=
"danger"
>
Error
</ElButton>
<ElButton
type=
"danger"
>
Error
</ElButton>
</ElSpace>
</ElSpace>
</ElCard>
</ElCard>
<ElCard
class=
"mb-5
"
>
<ElCard
class=
"mb-5 w-80
"
>
<
template
#
header
>
Message
</
template
>
<
template
#
header
>
Message
</
template
>
<ElSpace>
<ElSpace>
<ElButton
type=
"info"
@
click=
"info"
>
信息
</ElButton>
<ElButton
type=
"info"
@
click=
"info"
>
信息
</ElButton>
...
@@ -82,7 +83,7 @@ const segmentedOptions = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
...
@@ -82,7 +83,7 @@ const segmentedOptions = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
<ElButton
type=
"success"
@
click=
"success"
>
成功
</ElButton>
<ElButton
type=
"success"
@
click=
"success"
>
成功
</ElButton>
</ElSpace>
</ElSpace>
</ElCard>
</ElCard>
<ElCard
class=
"mb-5
"
>
<ElCard
class=
"mb-5 w-80
"
>
<
template
#
header
>
Notification
</
template
>
<
template
#
header
>
Notification
</
template
>
<ElSpace>
<ElSpace>
<ElButton
type=
"info"
@
click=
"notify('info')"
>
信息
</ElButton>
<ElButton
type=
"info"
@
click=
"notify('info')"
>
信息
</ElButton>
...
@@ -91,7 +92,7 @@ const segmentedOptions = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
...
@@ -91,7 +92,7 @@ const segmentedOptions = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
<ElButton
type=
"success"
@
click=
"notify('success')"
>
成功
</ElButton>
<ElButton
type=
"success"
@
click=
"notify('success')"
>
成功
</ElButton>
</ElSpace>
</ElSpace>
</ElCard>
</ElCard>
<ElCard
class=
"mb-5
"
>
<ElCard
class=
"mb-5 w-auto
"
>
<
template
#
header
>
Segmented
</
template
>
<
template
#
header
>
Segmented
</
template
>
<ElSegmented
<ElSegmented
v-model=
"segmentedValue"
v-model=
"segmentedValue"
...
@@ -99,11 +100,18 @@ const segmentedOptions = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
...
@@ -99,11 +100,18 @@ const segmentedOptions = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
size=
"large"
size=
"large"
/>
/>
</ElCard>
</ElCard>
<ElCard
class=
"mb-5"
>
<ElCard
class=
"mb-5 w-80"
>
<
template
#
header
>
V-Loading
</
template
>
<div
class=
"flex size-72 items-center justify-center"
v-loading=
"true"
>
一些演示的内容
</div>
</ElCard>
<ElCard
class=
"mb-5 w-80"
>
<ElTable
:data=
"tableData"
stripe
>
<ElTable
:data=
"tableData"
stripe
>
<ElTable
.
TableColumn
label=
"测试列1"
prop=
"prop1"
/>
<ElTable
.
TableColumn
label=
"测试列1"
prop=
"prop1"
/>
<ElTable
.
TableColumn
label=
"测试列2"
prop=
"prop2"
/>
<ElTable
.
TableColumn
label=
"测试列2"
prop=
"prop2"
/>
</ElTable>
</ElTable>
</ElCard>
</ElCard>
</div>
</Page>
</Page>
</template>
</template>
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment