日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

054_Empty空状态

發(fā)布時間:2025/5/22 编程问答 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 054_Empty空状态 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

1. Empty空狀態(tài)

1.1. 空狀態(tài)時的占位提示。

1.2. Empty Attributes

參數(shù)

說明

類型

可選值

默認(rèn)值

image

圖片地址

string

image-size

圖片大小(寬度)

number

description

文本描述

string

1.3. Empty Slots

name

說明

default

自定義底部內(nèi)容

image

自定義圖片

description

自定義描述文字

2. Empty空狀態(tài)例子

2.1. 使用腳手架新建一個名為element-ui-empty折疊面板的前端項目, 同時安裝Element插件。

2.2. 編輯index.js?

import Vue from 'vue' import VueRouter from 'vue-router' import Empty from '../components/Empty.vue' import ImageEmpty from '../components/ImageEmpty.vue' import SizeEmpty from '../components/SizeEmpty.vue' import SlotsEmpty from '../components/SlotsEmpty.vue'Vue.use(VueRouter)const routes = [{ path: '/', redirect: '/Empty' },{ path: '/Empty', component: Empty },{ path: '/ImageEmpty', component: ImageEmpty },{ path: '/SizeEmpty', component: SizeEmpty },{ path: '/SlotsEmpty', component: SlotsEmpty } ]const router = new VueRouter({routes })export default router

2.3. 在components下創(chuàng)建Empty.vue

<template><div><h1>基礎(chǔ)用法</h1><el-empty description="這是空狀態(tài)的描述文字"></el-empty></div> </template>

2.4. 在components下創(chuàng)建ImageEmpty.vue

<template><div><h1>自定義圖片</h1><h4>通過設(shè)置image屬性傳入圖片URL。</h4><el-empty image="https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png"></el-empty></div> </template>

2.5. 在components下創(chuàng)建SizeEmpty.vue

<template><div><h1>圖片尺寸</h1><h4>通過設(shè)置image-size屬性來控制圖片大小。</h4><el-empty :image-size="200"></el-empty></div> </template>

2.6. 在components下創(chuàng)建SlotsEmpty.vue

<template><div><h1>底部內(nèi)容</h1><h4>使用默認(rèn)插槽可在底部插入內(nèi)容。</h4><el-empty><template slot="default"><el-button type="primary">按鈕</el-button></template></el-empty></div> </template>

2.7. 運行項目, 訪問http://localhost:8080/#/Empty

2.8. 運行項目, 訪問http://localhost:8080/#/ImageEmpty

2.9. 運行項目, 訪問http://localhost:8080/#/SizeEmpty

2.10. 運行項目, 訪問http://localhost:8080/#/SlotsEmpty

總結(jié)

以上是生活随笔為你收集整理的054_Empty空状态的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。