You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
77 lines
2.1 KiB
77 lines
2.1 KiB
<html>
|
|
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
|
<script src="https://unpkg.com/vue@3"></script>
|
|
|
|
<!-- import CSS -->
|
|
<link rel="stylesheet" href="https://unpkg.com/element-plus/dist/index.css">
|
|
<!-- import JavaScript -->
|
|
<script src="https://unpkg.com/element-plus"></script>
|
|
<title>Element Plus demo</title>
|
|
<style>
|
|
.icon-list {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fill, 115px);
|
|
justify-content: space-evenly;
|
|
max-height: 70vh;
|
|
}
|
|
|
|
.icon-item {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
width: 42px;
|
|
padding: 20px 30px;
|
|
cursor: pointer;
|
|
transition: all .2s;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<div id="app">
|
|
<div class="icon-list">
|
|
<div v-for="item in iconsList" :key="item" class="icon-item" @click="adsfa(item)">
|
|
<component :is="item" style="width: 20px;"></component>
|
|
<span>{{item}}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="https://unpkg.com/@element-plus/icons-vue"></script>
|
|
<script>
|
|
const App = {
|
|
data() {
|
|
return {
|
|
message: "Hello Element Plus",
|
|
|
|
iconsList: []
|
|
};
|
|
},
|
|
mounted() {
|
|
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
|
this.iconsList.push(key);
|
|
// app.component(key, component)
|
|
}
|
|
},
|
|
methods: {
|
|
adsfa(item) {
|
|
console.log(item);
|
|
},
|
|
|
|
},
|
|
};
|
|
const app = Vue.createApp(App);
|
|
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
|
app.component(key, component)
|
|
}
|
|
app.use(ElementPlus);
|
|
app.mount("#app");
|
|
</script>
|
|
|
|
|
|
</body>
|
|
|
|
</html> |