mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-14 09:20:51 +08:00
37 lines
1.0 KiB
Vue
37 lines
1.0 KiB
Vue
<template>
|
|
<el-dropdown @command="handleCommand">
|
|
<span class="el-dropdown-link">
|
|
Dropdown List<el-icon class="el-icon--right"><arrow-down /></el-icon>
|
|
</span>
|
|
<template #dropdown>
|
|
<el-dropdown-menu>
|
|
<el-dropdown-item command="a">Action 1</el-dropdown-item>
|
|
<el-dropdown-item command="b">Action 2</el-dropdown-item>
|
|
<el-dropdown-item command="c">Action 3</el-dropdown-item>
|
|
<el-dropdown-item command="d" disabled>Action 4</el-dropdown-item>
|
|
<el-dropdown-item command="e" divided>Action 5</el-dropdown-item>
|
|
</el-dropdown-menu>
|
|
</template>
|
|
</el-dropdown>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { defineComponent } from 'vue'
|
|
import { ElMessage } from 'element-plus'
|
|
import { ArrowDown } from '@element-plus/icons-vue'
|
|
|
|
export default defineComponent({
|
|
components: {
|
|
ArrowDown,
|
|
},
|
|
setup() {
|
|
const handleCommand = (command) => {
|
|
ElMessage(`click on item ${command}`)
|
|
}
|
|
return {
|
|
handleCommand,
|
|
}
|
|
},
|
|
})
|
|
</script>
|