<!DOCTYPE html>
<html>
<head>
<script src="./main.ts"></script>
</head>
<body>
<div id='app'></div>
</body>
</html>
推荐
旧版
<!DOCTYPE html>
<html>
<head>
<script src="./main.ts"></script>
</head>
<body>
<div id='app'></div>
</body>
</html>
import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import App from './App.vue'
const app = createApp(App)
app.use(ElementPlus, { size: 'small', zIndex: 3000 })
app.mount('#app')
console.log(["Hello 笔.COOL 控制台"], ElementPlus)
<script setup>
import ElementPlusDemo from './ElementPlusDemo.vue'
</script>
<template>
<div class="container">
<ElementPlusDemo />
</div>
</template>
<style scoped>
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
}
</style>
<script setup>
import { ref } from 'vue'
import {
Check,
Delete,
Edit,
Message,
Search,
Star,
} from '@element-plus/icons-vue'
</script>
<template>
<div class="mb-4">
<el-button>Default</el-button>
<el-button type="primary">Primary</el-button>
<el-button type="success">Success</el-button>
<el-button type="info">Info</el-button>
<el-button type="warning">Warning</el-button>
<el-button type="danger">Danger</el-button>
</div>
<div class="mb-4">
<el-button plain>Plain</el-button>
<el-button type="primary" plain>Primary</el-button>
<el-button type="success" plain>Success</el-button>
<el-button type="info" plain>Info</el-button>
<el-button type="warning" plain>Warning</el-button>
<el-button type="danger" plain>Danger</el-button>
</div>
<div class="mb-4">
<el-button round>Round</el-button>
<el-button type="primary" round>Primary</el-button>
<el-button type="success" round>Success</el-button>
<el-button type="info" round>Info</el-button>
<el-button type="warning" round>Warning</el-button>
<el-button type="danger" round>Danger</el-button>
</div>
<div>
<el-button :icon="Search" circle />
<el-button type="primary" :icon="Edit" circle />
<el-button type="success" :icon="Check" circle />
<el-button type="info" :icon="Message" circle />
<el-button type="warning" :icon="Star" circle />
<el-button type="danger" :icon="Delete" circle />
</div>
</template>
<style scoped>
.mb-4 {
margin-bottom: 1rem;
}
</style>
{
"dependencies": {
"vue": "^3.5.13",
"element-plus": "^2.9.3",
"@element-plus/icons-vue": "^2.3.1"
}
}