feat: v-loading support for `element plus` (#5008)
							parent
							
								
									e23486dbc6
								
							
						
					
					
						commit
						fccbe44cf7
					
				|  | @ -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) { | ||||||
|   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); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -61,49 +61,57 @@ 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"> | ||||||
|       <template #header> 按钮 </template> |       <ElCard class="mb-5 w-auto"> | ||||||
|       <ElSpace> |         <template #header> 按钮 </template> | ||||||
|         <ElButton text>Text</ElButton> |         <ElSpace> | ||||||
|         <ElButton>Default</ElButton> |           <ElButton text>Text</ElButton> | ||||||
|         <ElButton type="primary"> Primary </ElButton> |           <ElButton>Default</ElButton> | ||||||
|         <ElButton type="info"> Info </ElButton> |           <ElButton type="primary"> Primary </ElButton> | ||||||
|         <ElButton type="success"> Success </ElButton> |           <ElButton type="info"> Info </ElButton> | ||||||
|         <ElButton type="warning"> Warning </ElButton> |           <ElButton type="success"> Success </ElButton> | ||||||
|         <ElButton type="danger"> Error </ElButton> |           <ElButton type="warning"> Warning </ElButton> | ||||||
|       </ElSpace> |           <ElButton type="danger"> Error </ElButton> | ||||||
|     </ElCard> |         </ElSpace> | ||||||
|     <ElCard class="mb-5"> |       </ElCard> | ||||||
|       <template #header> Message </template> |       <ElCard class="mb-5 w-80"> | ||||||
|       <ElSpace> |         <template #header> Message </template> | ||||||
|         <ElButton type="info" @click="info"> 信息 </ElButton> |         <ElSpace> | ||||||
|         <ElButton type="danger" @click="error"> 错误 </ElButton> |           <ElButton type="info" @click="info"> 信息 </ElButton> | ||||||
|         <ElButton type="warning" @click="warning"> 警告 </ElButton> |           <ElButton type="danger" @click="error"> 错误 </ElButton> | ||||||
|         <ElButton type="success" @click="success"> 成功 </ElButton> |           <ElButton type="warning" @click="warning"> 警告 </ElButton> | ||||||
|       </ElSpace> |           <ElButton type="success" @click="success"> 成功 </ElButton> | ||||||
|     </ElCard> |         </ElSpace> | ||||||
|     <ElCard class="mb-5"> |       </ElCard> | ||||||
|       <template #header> Notification </template> |       <ElCard class="mb-5 w-80"> | ||||||
|       <ElSpace> |         <template #header> Notification </template> | ||||||
|         <ElButton type="info" @click="notify('info')"> 信息 </ElButton> |         <ElSpace> | ||||||
|         <ElButton type="danger" @click="notify('error')"> 错误 </ElButton> |           <ElButton type="info" @click="notify('info')"> 信息 </ElButton> | ||||||
|         <ElButton type="warning" @click="notify('warning')"> 警告 </ElButton> |           <ElButton type="danger" @click="notify('error')"> 错误 </ElButton> | ||||||
|         <ElButton type="success" @click="notify('success')"> 成功 </ElButton> |           <ElButton type="warning" @click="notify('warning')"> 警告 </ElButton> | ||||||
|       </ElSpace> |           <ElButton type="success" @click="notify('success')"> 成功 </ElButton> | ||||||
|     </ElCard> |         </ElSpace> | ||||||
|     <ElCard class="mb-5"> |       </ElCard> | ||||||
|       <template #header> Segmented </template> |       <ElCard class="mb-5 w-auto"> | ||||||
|       <ElSegmented |         <template #header> Segmented </template> | ||||||
|         v-model="segmentedValue" |         <ElSegmented | ||||||
|         :options="segmentedOptions" |           v-model="segmentedValue" | ||||||
|         size="large" |           :options="segmentedOptions" | ||||||
|       /> |           size="large" | ||||||
|     </ElCard> |         /> | ||||||
|     <ElCard class="mb-5"> |       </ElCard> | ||||||
|       <ElTable :data="tableData" stripe> |       <ElCard class="mb-5 w-80"> | ||||||
|         <ElTable.TableColumn label="测试列1" prop="prop1" /> |         <template #header> V-Loading </template> | ||||||
|         <ElTable.TableColumn label="测试列2" prop="prop2" /> |         <div class="flex size-72 items-center justify-center" v-loading="true"> | ||||||
|       </ElTable> |           一些演示的内容 | ||||||
|     </ElCard> |         </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> |   </Page> | ||||||
| </template> | </template> | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 Netfan
						Netfan