@templmf/temp-solf-lmf 0.0.28 → 0.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/skills/code-reviewer/SKILL.md +482 -0
- package/skills/daily-qa-skill/SKILL.md +147 -0
- package/skills/daily-qa-skill/references/tools.md +130 -0
- package/skills/element-plus-vue3/LICENSE.txt +202 -0
- package/skills/element-plus-vue3/SKILL.md +218 -0
- package/skills/element-plus-vue3/api/component-api.md +94 -0
- package/skills/element-plus-vue3/api/global-config.md +89 -0
- package/skills/element-plus-vue3/api/props-and-events.md +101 -0
- package/skills/element-plus-vue3/examples/components/button.md +99 -0
- package/skills/element-plus-vue3/examples/components/date-picker.md +115 -0
- package/skills/element-plus-vue3/examples/components/dialog.md +106 -0
- package/skills/element-plus-vue3/examples/components/form.md +127 -0
- package/skills/element-plus-vue3/examples/components/input.md +123 -0
- package/skills/element-plus-vue3/examples/components/message.md +93 -0
- package/skills/element-plus-vue3/examples/components/overview.md +59 -0
- package/skills/element-plus-vue3/examples/components/select.md +133 -0
- package/skills/element-plus-vue3/examples/components/table.md +166 -0
- package/skills/element-plus-vue3/examples/guide/design.md +68 -0
- package/skills/element-plus-vue3/examples/guide/global-config.md +95 -0
- package/skills/element-plus-vue3/examples/guide/i18n.md +95 -0
- package/skills/element-plus-vue3/examples/guide/installation.md +110 -0
- package/skills/element-plus-vue3/examples/guide/quick-start.md +103 -0
- package/skills/element-plus-vue3/examples/guide/theme.md +78 -0
- package/skills/element-plus-vue3/templates/component-usage.md +92 -0
- package/skills/element-plus-vue3/templates/installation.md +82 -0
- package/skills/element-plus-vue3/templates/project-setup.md +83 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Global Configuration
|
|
2
|
+
|
|
3
|
+
## Instructions
|
|
4
|
+
|
|
5
|
+
This example demonstrates how to configure Element Plus globally.
|
|
6
|
+
|
|
7
|
+
### Key Concepts
|
|
8
|
+
|
|
9
|
+
- Global config options
|
|
10
|
+
- ConfigProvider
|
|
11
|
+
- Size configuration
|
|
12
|
+
- z-index configuration
|
|
13
|
+
|
|
14
|
+
### Example: Global Config
|
|
15
|
+
|
|
16
|
+
```javascript
|
|
17
|
+
// main.js
|
|
18
|
+
import { createApp } from 'vue'
|
|
19
|
+
import ElementPlus from 'element-plus'
|
|
20
|
+
import 'element-plus/dist/index.css'
|
|
21
|
+
import App from './App.vue'
|
|
22
|
+
|
|
23
|
+
const app = createApp(App)
|
|
24
|
+
app.use(ElementPlus, {
|
|
25
|
+
size: 'large',
|
|
26
|
+
zIndex: 3000,
|
|
27
|
+
locale: zhCn
|
|
28
|
+
})
|
|
29
|
+
app.mount('#app')
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Example: Using ConfigProvider
|
|
33
|
+
|
|
34
|
+
```vue
|
|
35
|
+
<template>
|
|
36
|
+
<el-config-provider :size="size" :z-index="zIndex" :locale="locale">
|
|
37
|
+
<el-button>Button</el-button>
|
|
38
|
+
<el-input v-model="input" />
|
|
39
|
+
</el-config-provider>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<script setup>
|
|
43
|
+
import { ref } from 'vue'
|
|
44
|
+
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
|
45
|
+
|
|
46
|
+
const size = ref('default')
|
|
47
|
+
const zIndex = ref(3000)
|
|
48
|
+
const locale = ref(zhCn)
|
|
49
|
+
const input = ref('')
|
|
50
|
+
</script>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Example: Size Configuration
|
|
54
|
+
|
|
55
|
+
```vue
|
|
56
|
+
<template>
|
|
57
|
+
<el-config-provider :size="size">
|
|
58
|
+
<el-button>Button</el-button>
|
|
59
|
+
<el-input v-model="input" />
|
|
60
|
+
</el-config-provider>
|
|
61
|
+
</template>
|
|
62
|
+
|
|
63
|
+
<script setup>
|
|
64
|
+
import { ref } from 'vue'
|
|
65
|
+
|
|
66
|
+
const size = ref('default') // 'large' | 'default' | 'small'
|
|
67
|
+
</script>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Example: z-index Configuration
|
|
71
|
+
|
|
72
|
+
```vue
|
|
73
|
+
<template>
|
|
74
|
+
<el-config-provider :z-index="zIndex">
|
|
75
|
+
<el-dialog v-model="visible" title="Dialog">
|
|
76
|
+
Content
|
|
77
|
+
</el-dialog>
|
|
78
|
+
</el-config-provider>
|
|
79
|
+
</template>
|
|
80
|
+
|
|
81
|
+
<script setup>
|
|
82
|
+
import { ref } from 'vue'
|
|
83
|
+
|
|
84
|
+
const zIndex = ref(3000)
|
|
85
|
+
const visible = ref(false)
|
|
86
|
+
</script>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Key Points
|
|
90
|
+
|
|
91
|
+
- Configure globally via app.use()
|
|
92
|
+
- Use ConfigProvider for component-level config
|
|
93
|
+
- Size: 'large' | 'default' | 'small'
|
|
94
|
+
- z-index: number (default: 3000)
|
|
95
|
+
- Locale: locale object
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Internationalization (i18n)
|
|
2
|
+
|
|
3
|
+
## Instructions
|
|
4
|
+
|
|
5
|
+
This example demonstrates how to configure internationalization in Element Plus.
|
|
6
|
+
|
|
7
|
+
### Key Concepts
|
|
8
|
+
|
|
9
|
+
- Locale configuration
|
|
10
|
+
- Language switching
|
|
11
|
+
- DatePicker locale
|
|
12
|
+
- ConfigProvider
|
|
13
|
+
|
|
14
|
+
### Example: Basic i18n Setup
|
|
15
|
+
|
|
16
|
+
```javascript
|
|
17
|
+
// main.js
|
|
18
|
+
import { createApp } from 'vue'
|
|
19
|
+
import ElementPlus from 'element-plus'
|
|
20
|
+
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
|
21
|
+
import en from 'element-plus/dist/locale/en.mjs'
|
|
22
|
+
import App from './App.vue'
|
|
23
|
+
|
|
24
|
+
const app = createApp(App)
|
|
25
|
+
app.use(ElementPlus, {
|
|
26
|
+
locale: zhCn
|
|
27
|
+
})
|
|
28
|
+
app.mount('#app')
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Example: Using ConfigProvider
|
|
32
|
+
|
|
33
|
+
```vue
|
|
34
|
+
<template>
|
|
35
|
+
<el-config-provider :locale="locale">
|
|
36
|
+
<el-date-picker v-model="date" />
|
|
37
|
+
</el-config-provider>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<script setup>
|
|
41
|
+
import { ref } from 'vue'
|
|
42
|
+
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
|
43
|
+
import en from 'element-plus/dist/locale/en.mjs'
|
|
44
|
+
|
|
45
|
+
const locale = ref(zhCn)
|
|
46
|
+
const date = ref('')
|
|
47
|
+
</script>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Example: Language Switching
|
|
51
|
+
|
|
52
|
+
```vue
|
|
53
|
+
<template>
|
|
54
|
+
<el-config-provider :locale="currentLocale">
|
|
55
|
+
<el-select v-model="language" @change="handleLanguageChange">
|
|
56
|
+
<el-option label="中文" value="zh-cn" />
|
|
57
|
+
<el-option label="English" value="en" />
|
|
58
|
+
</el-select>
|
|
59
|
+
<el-date-picker v-model="date" />
|
|
60
|
+
</el-config-provider>
|
|
61
|
+
</template>
|
|
62
|
+
|
|
63
|
+
<script setup>
|
|
64
|
+
import { ref } from 'vue'
|
|
65
|
+
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
|
66
|
+
import en from 'element-plus/dist/locale/en.mjs'
|
|
67
|
+
|
|
68
|
+
const language = ref('zh-cn')
|
|
69
|
+
const currentLocale = ref(zhCn)
|
|
70
|
+
const date = ref('')
|
|
71
|
+
|
|
72
|
+
const handleLanguageChange = (value) => {
|
|
73
|
+
currentLocale.value = value === 'zh-cn' ? zhCn : en
|
|
74
|
+
}
|
|
75
|
+
</script>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Example: Available Locales
|
|
79
|
+
|
|
80
|
+
```javascript
|
|
81
|
+
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
|
82
|
+
import en from 'element-plus/dist/locale/en.mjs'
|
|
83
|
+
import es from 'element-plus/dist/locale/es.mjs'
|
|
84
|
+
import fr from 'element-plus/dist/locale/fr.mjs'
|
|
85
|
+
import ja from 'element-plus/dist/locale/ja.mjs'
|
|
86
|
+
import ko from 'element-plus/dist/locale/ko.mjs'
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Key Points
|
|
90
|
+
|
|
91
|
+
- Import locale files
|
|
92
|
+
- Configure locale globally or per component
|
|
93
|
+
- Use ConfigProvider for locale
|
|
94
|
+
- Support multiple languages
|
|
95
|
+
- DatePicker uses Day.js locale
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Installation
|
|
2
|
+
|
|
3
|
+
## Instructions
|
|
4
|
+
|
|
5
|
+
This example demonstrates how to install Element Plus in a Vue 3 project.
|
|
6
|
+
|
|
7
|
+
### Key Concepts
|
|
8
|
+
|
|
9
|
+
- Package installation
|
|
10
|
+
- Full import
|
|
11
|
+
- On-demand import
|
|
12
|
+
- CDN import
|
|
13
|
+
- Compatibility
|
|
14
|
+
|
|
15
|
+
### Example: Package Installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# Using npm
|
|
19
|
+
npm install element-plus
|
|
20
|
+
|
|
21
|
+
# Using yarn
|
|
22
|
+
yarn add element-plus
|
|
23
|
+
|
|
24
|
+
# Using pnpm
|
|
25
|
+
pnpm add element-plus
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Example: Full Import
|
|
29
|
+
|
|
30
|
+
```javascript
|
|
31
|
+
// main.js
|
|
32
|
+
import { createApp } from 'vue'
|
|
33
|
+
import ElementPlus from 'element-plus'
|
|
34
|
+
import 'element-plus/dist/index.css'
|
|
35
|
+
import App from './App.vue'
|
|
36
|
+
|
|
37
|
+
const app = createApp(App)
|
|
38
|
+
app.use(ElementPlus)
|
|
39
|
+
app.mount('#app')
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Example: On-Demand Import
|
|
43
|
+
|
|
44
|
+
```javascript
|
|
45
|
+
// main.js
|
|
46
|
+
import { createApp } from 'vue'
|
|
47
|
+
import { ElButton, ElInput } from 'element-plus'
|
|
48
|
+
import 'element-plus/es/components/button/style/css'
|
|
49
|
+
import 'element-plus/es/components/input/style/css'
|
|
50
|
+
import App from './App.vue'
|
|
51
|
+
|
|
52
|
+
const app = createApp(App)
|
|
53
|
+
app.component(ElButton.name, ElButton)
|
|
54
|
+
app.component(ElInput.name, ElInput)
|
|
55
|
+
app.mount('#app')
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Example: CDN Import
|
|
59
|
+
|
|
60
|
+
```html
|
|
61
|
+
<!DOCTYPE html>
|
|
62
|
+
<html>
|
|
63
|
+
<head>
|
|
64
|
+
<link rel="stylesheet" href="https://unpkg.com/element-plus/dist/index.css" />
|
|
65
|
+
</head>
|
|
66
|
+
<body>
|
|
67
|
+
<div id="app"></div>
|
|
68
|
+
<script src="https://unpkg.com/vue@next"></script>
|
|
69
|
+
<script src="https://unpkg.com/element-plus"></script>
|
|
70
|
+
<script>
|
|
71
|
+
const { createApp } = Vue
|
|
72
|
+
const app = createApp({})
|
|
73
|
+
app.use(ElementPlus)
|
|
74
|
+
app.mount('#app')
|
|
75
|
+
</script>
|
|
76
|
+
</body>
|
|
77
|
+
</html>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Example: Auto Import with unplugin-vue-components
|
|
81
|
+
|
|
82
|
+
```javascript
|
|
83
|
+
// vite.config.js
|
|
84
|
+
import { defineConfig } from 'vite'
|
|
85
|
+
import vue from '@vitejs/plugin-vue'
|
|
86
|
+
import AutoImport from 'unplugin-auto-import/vite'
|
|
87
|
+
import Components from 'unplugin-vue-components/vite'
|
|
88
|
+
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
|
|
89
|
+
|
|
90
|
+
export default defineConfig({
|
|
91
|
+
plugins: [
|
|
92
|
+
vue(),
|
|
93
|
+
AutoImport({
|
|
94
|
+
resolvers: [ElementPlusResolver()],
|
|
95
|
+
}),
|
|
96
|
+
Components({
|
|
97
|
+
resolvers: [ElementPlusResolver()],
|
|
98
|
+
}),
|
|
99
|
+
],
|
|
100
|
+
})
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Key Points
|
|
104
|
+
|
|
105
|
+
- Install element-plus package
|
|
106
|
+
- Choose between full import or on-demand import
|
|
107
|
+
- Import CSS styles
|
|
108
|
+
- Use app.use() for full import
|
|
109
|
+
- Use auto-import plugins for better DX
|
|
110
|
+
- Element Plus requires Vue 3
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Quick Start
|
|
2
|
+
|
|
3
|
+
## Instructions
|
|
4
|
+
|
|
5
|
+
This example provides a quick start guide for Element Plus.
|
|
6
|
+
|
|
7
|
+
### Key Concepts
|
|
8
|
+
|
|
9
|
+
- Basic setup
|
|
10
|
+
- First component
|
|
11
|
+
- Global configuration
|
|
12
|
+
- Component usage
|
|
13
|
+
|
|
14
|
+
### Example: Basic Setup
|
|
15
|
+
|
|
16
|
+
```vue
|
|
17
|
+
<template>
|
|
18
|
+
<el-button type="primary">Button</el-button>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script setup>
|
|
22
|
+
// Component is auto-imported if using unplugin-vue-components
|
|
23
|
+
</script>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Example: With Options API
|
|
27
|
+
|
|
28
|
+
```vue
|
|
29
|
+
<template>
|
|
30
|
+
<el-button type="primary" @click="handleClick">
|
|
31
|
+
Click Me
|
|
32
|
+
</el-button>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<script>
|
|
36
|
+
export default {
|
|
37
|
+
methods: {
|
|
38
|
+
handleClick() {
|
|
39
|
+
console.log('Button clicked')
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
</script>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Example: With Composition API
|
|
47
|
+
|
|
48
|
+
```vue
|
|
49
|
+
<template>
|
|
50
|
+
<el-button type="primary" @click="handleClick">
|
|
51
|
+
Click Me
|
|
52
|
+
</el-button>
|
|
53
|
+
</template>
|
|
54
|
+
|
|
55
|
+
<script setup>
|
|
56
|
+
const handleClick = () => {
|
|
57
|
+
console.log('Button clicked')
|
|
58
|
+
}
|
|
59
|
+
</script>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Example: Global Configuration
|
|
63
|
+
|
|
64
|
+
```javascript
|
|
65
|
+
// main.js
|
|
66
|
+
import { createApp } from 'vue'
|
|
67
|
+
import ElementPlus from 'element-plus'
|
|
68
|
+
import 'element-plus/dist/index.css'
|
|
69
|
+
import App from './App.vue'
|
|
70
|
+
|
|
71
|
+
const app = createApp(App)
|
|
72
|
+
app.use(ElementPlus, {
|
|
73
|
+
size: 'large',
|
|
74
|
+
zIndex: 3000
|
|
75
|
+
})
|
|
76
|
+
app.mount('#app')
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Example: Using ConfigProvider
|
|
80
|
+
|
|
81
|
+
```vue
|
|
82
|
+
<template>
|
|
83
|
+
<el-config-provider :locale="locale" :size="size">
|
|
84
|
+
<el-button>Button</el-button>
|
|
85
|
+
</el-config-provider>
|
|
86
|
+
</template>
|
|
87
|
+
|
|
88
|
+
<script setup>
|
|
89
|
+
import { ref } from 'vue'
|
|
90
|
+
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
|
91
|
+
|
|
92
|
+
const locale = ref(zhCn)
|
|
93
|
+
const size = ref('default')
|
|
94
|
+
</script>
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Key Points
|
|
98
|
+
|
|
99
|
+
- Use el- prefix for components
|
|
100
|
+
- Support both Options API and Composition API
|
|
101
|
+
- Configure globally or per component
|
|
102
|
+
- Use ConfigProvider for locale and size
|
|
103
|
+
- Import styles for components
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Theme Customization
|
|
2
|
+
|
|
3
|
+
## Instructions
|
|
4
|
+
|
|
5
|
+
This example demonstrates how to customize Element Plus theme.
|
|
6
|
+
|
|
7
|
+
### Key Concepts
|
|
8
|
+
|
|
9
|
+
- CSS variables
|
|
10
|
+
- SCSS variables
|
|
11
|
+
- Theme builder
|
|
12
|
+
- Color customization
|
|
13
|
+
|
|
14
|
+
### Example: Using CSS Variables
|
|
15
|
+
|
|
16
|
+
```vue
|
|
17
|
+
<template>
|
|
18
|
+
<el-button type="primary">Button</el-button>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<style>
|
|
22
|
+
:root {
|
|
23
|
+
--el-color-primary: #409eff;
|
|
24
|
+
--el-color-success: #67c23a;
|
|
25
|
+
--el-color-warning: #e6a23c;
|
|
26
|
+
--el-color-danger: #f56c6c;
|
|
27
|
+
--el-color-info: #909399;
|
|
28
|
+
}
|
|
29
|
+
</style>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Example: SCSS Variables
|
|
33
|
+
|
|
34
|
+
```scss
|
|
35
|
+
// variables.scss
|
|
36
|
+
$--color-primary: #409eff;
|
|
37
|
+
$--color-success: #67c23a;
|
|
38
|
+
$--color-warning: #e6a23c;
|
|
39
|
+
$--color-danger: #f56c6c;
|
|
40
|
+
$--color-info: #909399;
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Example: Import Custom Theme
|
|
44
|
+
|
|
45
|
+
```javascript
|
|
46
|
+
// main.js
|
|
47
|
+
import { createApp } from 'vue'
|
|
48
|
+
import ElementPlus from 'element-plus'
|
|
49
|
+
import './theme/index.css'
|
|
50
|
+
import App from './App.vue'
|
|
51
|
+
|
|
52
|
+
const app = createApp(App)
|
|
53
|
+
app.use(ElementPlus)
|
|
54
|
+
app.mount('#app')
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Example: Component-Level Customization
|
|
58
|
+
|
|
59
|
+
```vue
|
|
60
|
+
<template>
|
|
61
|
+
<el-button class="custom-button">Button</el-button>
|
|
62
|
+
</template>
|
|
63
|
+
|
|
64
|
+
<style scoped>
|
|
65
|
+
.custom-button {
|
|
66
|
+
--el-button-bg-color: #409eff;
|
|
67
|
+
--el-button-text-color: #fff;
|
|
68
|
+
}
|
|
69
|
+
</style>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Key Points
|
|
73
|
+
|
|
74
|
+
- Use CSS variables for customization
|
|
75
|
+
- Override theme variables
|
|
76
|
+
- Use SCSS for advanced customization
|
|
77
|
+
- Component-level customization supported
|
|
78
|
+
- Use theme builder for visual customization
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Component Usage Templates
|
|
2
|
+
|
|
3
|
+
## Button Usage
|
|
4
|
+
|
|
5
|
+
```vue
|
|
6
|
+
<template>
|
|
7
|
+
<el-button type="primary" @click="handleClick">
|
|
8
|
+
Click Me
|
|
9
|
+
</el-button>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup>
|
|
13
|
+
const handleClick = () => {
|
|
14
|
+
console.log('Clicked')
|
|
15
|
+
}
|
|
16
|
+
</script>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Form Usage
|
|
20
|
+
|
|
21
|
+
```vue
|
|
22
|
+
<template>
|
|
23
|
+
<el-form :model="form" :rules="rules" ref="formRef">
|
|
24
|
+
<el-form-item label="Name" prop="name">
|
|
25
|
+
<el-input v-model="form.name" />
|
|
26
|
+
</el-form-item>
|
|
27
|
+
<el-form-item>
|
|
28
|
+
<el-button type="primary" @click="handleSubmit">Submit</el-button>
|
|
29
|
+
</el-form-item>
|
|
30
|
+
</el-form>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<script setup>
|
|
34
|
+
import { ref } from 'vue'
|
|
35
|
+
|
|
36
|
+
const formRef = ref()
|
|
37
|
+
const form = ref({
|
|
38
|
+
name: ''
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
const rules = {
|
|
42
|
+
name: [
|
|
43
|
+
{ required: true, message: 'Please input name', trigger: 'blur' }
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const handleSubmit = async () => {
|
|
48
|
+
await formRef.value.validate((valid) => {
|
|
49
|
+
if (valid) {
|
|
50
|
+
console.log('Form:', form.value)
|
|
51
|
+
}
|
|
52
|
+
})
|
|
53
|
+
}
|
|
54
|
+
</script>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Table Usage
|
|
58
|
+
|
|
59
|
+
```vue
|
|
60
|
+
<template>
|
|
61
|
+
<el-table :data="tableData">
|
|
62
|
+
<el-table-column prop="name" label="Name" />
|
|
63
|
+
<el-table-column prop="email" label="Email" />
|
|
64
|
+
</el-table>
|
|
65
|
+
</template>
|
|
66
|
+
|
|
67
|
+
<script setup>
|
|
68
|
+
import { ref } from 'vue'
|
|
69
|
+
|
|
70
|
+
const tableData = ref([
|
|
71
|
+
{ name: 'John', email: 'john@example.com' },
|
|
72
|
+
{ name: 'Jane', email: 'jane@example.com' }
|
|
73
|
+
])
|
|
74
|
+
</script>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Dialog Usage
|
|
78
|
+
|
|
79
|
+
```vue
|
|
80
|
+
<template>
|
|
81
|
+
<el-button @click="dialogVisible = true">Open Dialog</el-button>
|
|
82
|
+
<el-dialog v-model="dialogVisible" title="Dialog">
|
|
83
|
+
<span>Dialog Content</span>
|
|
84
|
+
</el-dialog>
|
|
85
|
+
</template>
|
|
86
|
+
|
|
87
|
+
<script setup>
|
|
88
|
+
import { ref } from 'vue'
|
|
89
|
+
|
|
90
|
+
const dialogVisible = ref(false)
|
|
91
|
+
</script>
|
|
92
|
+
```
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Installation Templates
|
|
2
|
+
|
|
3
|
+
## npm Installation
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install element-plus
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Full Import
|
|
10
|
+
|
|
11
|
+
```javascript
|
|
12
|
+
// main.js
|
|
13
|
+
import { createApp } from 'vue'
|
|
14
|
+
import ElementPlus from 'element-plus'
|
|
15
|
+
import 'element-plus/dist/index.css'
|
|
16
|
+
import App from './App.vue'
|
|
17
|
+
|
|
18
|
+
const app = createApp(App)
|
|
19
|
+
app.use(ElementPlus)
|
|
20
|
+
app.mount('#app')
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## On-Demand Import
|
|
24
|
+
|
|
25
|
+
```javascript
|
|
26
|
+
// main.js
|
|
27
|
+
import { createApp } from 'vue'
|
|
28
|
+
import { ElButton, ElInput } from 'element-plus'
|
|
29
|
+
import 'element-plus/es/components/button/style/css'
|
|
30
|
+
import 'element-plus/es/components/input/style/css'
|
|
31
|
+
import App from './App.vue'
|
|
32
|
+
|
|
33
|
+
const app = createApp(App)
|
|
34
|
+
app.component(ElButton.name, ElButton)
|
|
35
|
+
app.component(ElInput.name, ElInput)
|
|
36
|
+
app.mount('#app')
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Auto Import with unplugin-vue-components
|
|
40
|
+
|
|
41
|
+
```javascript
|
|
42
|
+
// vite.config.js
|
|
43
|
+
import { defineConfig } from 'vite'
|
|
44
|
+
import vue from '@vitejs/plugin-vue'
|
|
45
|
+
import AutoImport from 'unplugin-auto-import/vite'
|
|
46
|
+
import Components from 'unplugin-vue-components/vite'
|
|
47
|
+
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
|
|
48
|
+
|
|
49
|
+
export default defineConfig({
|
|
50
|
+
plugins: [
|
|
51
|
+
vue(),
|
|
52
|
+
AutoImport({
|
|
53
|
+
resolvers: [ElementPlusResolver()],
|
|
54
|
+
}),
|
|
55
|
+
Components({
|
|
56
|
+
resolvers: [ElementPlusResolver()],
|
|
57
|
+
}),
|
|
58
|
+
],
|
|
59
|
+
})
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## CDN Import
|
|
63
|
+
|
|
64
|
+
```html
|
|
65
|
+
<!DOCTYPE html>
|
|
66
|
+
<html>
|
|
67
|
+
<head>
|
|
68
|
+
<link rel="stylesheet" href="https://unpkg.com/element-plus/dist/index.css" />
|
|
69
|
+
</head>
|
|
70
|
+
<body>
|
|
71
|
+
<div id="app"></div>
|
|
72
|
+
<script src="https://unpkg.com/vue@next"></script>
|
|
73
|
+
<script src="https://unpkg.com/element-plus"></script>
|
|
74
|
+
<script>
|
|
75
|
+
const { createApp } = Vue
|
|
76
|
+
const app = createApp({})
|
|
77
|
+
app.use(ElementPlus)
|
|
78
|
+
app.mount('#app')
|
|
79
|
+
</script>
|
|
80
|
+
</body>
|
|
81
|
+
</html>
|
|
82
|
+
```
|