前端开发有很多流行框架,像React 、angular、vue等等,本文主要讲vue 给新手用的教程,其实官网已经写的很清楚,这里再啰嗦只是为了给新手提供一个更加简单明了的参考手册。

npm install element-plus --save

- import ElementPlus from 'element-plus'
- import 'element-plus/dist/index.css'
-
- import { createApp } from 'vue'
- import App from './App.vue'
-
- const app = createApp(App)
-
- app.use(ElementPlus)


npm run dev

npm i -D vite-plugin-windicss windicss
- import WindiCSS from 'vite-plugin-windicss'
-
-
- // https://vitejs.dev/config/
- export default defineConfig({
- plugins: [
- vue(),
- WindiCSS(),
- ],

import 'virtual:windi.css'

- <script setup>
- import {
- Check,
- Delete,
- Edit,
- Message,
- Search,
- Star,
- } from '@element-plus/icons-vue'
- </script>
-
- <template>
- <el-row class="dt">
-
- <el-button class="dt" type="primary">Primary</el-button>
-
- </el-row>
- </template>
-
- <style scoped>
- .dt{
- @apply bg-dark-50 border-red-300 rounded-2xl bg-green-500
- }
- </style>
关键代码如图所示

运行效果
