赞
踩
npm install element-plus --save
在main.js文件中引入ElementPlus
import { createApp } from 'vue'
import App from './App.vue'
import ElementPlus from 'element-plus' //全局引入
import 'element-plus/dist/index.css'
createApp(App).use(ElementPlus).use(store).use(router).mount('#app')
实现一个按钮并给按钮添加触发提示
<template> <div class="searchResultPage" style="overflow: hidden"> <div class="navTop"> <!-- 按钮 --> <el-tooltip class="box-item" effect="dark" content="点击下载数据" placement="top-start" > <el-button type="primary" :icon="Download" /> </el-tooltip> </div> <!-- 表格 --> <el-table id="myTable" style="width: 95%" :header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }" > <el-table-column prop="index" label="No." width="50" /> <el-table-column prop="courseID" label="字段1" /> <el-table-column prop="study" label="字段2" width="105" /> <el-table-column prop="visit" label="字段3" width="105" /> <el-table-column prop="type" label="字段4" /> </el-table> </div> </template>
<script>
import { onMounted } from "vue";
import { Download } from "@element-plus/icons-vue";
export default {
components: {},
setup() {
onMounted(() => {});
return {
Download,
};
},
};
</script>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。