element-ui下拉框选择

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.suoluomei.com/common/js2.0/vue/v2.5.16/vue.js"></script>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <!-- 引入组件库 -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
</head>
<style>

</style>
<body>
    <div id="app">
        <el-select v-model="labelee" placeholder="请选择" @change="selet()">
            <el-option
                    v-for="item in options"
                    :key="item.value"
                    :label="item.label"
                    :value="item.label">
            </el-option>
        </el-select>
    </div>
</body>
<script>
    new Vue({
        el:"#app",
        data:{
            options: [{
                value: '选项1',
                label: '黄金糕'
            }, {
                value: '选项2',
                label: '双皮奶'
            }, {
                value: '选项3',
                label: '蚵仔煎'
            }, {
                value: '选项4',
                label: '龙须面'
            }, {
                value: '选项5',
                label: '北京烤鸭'
            }],
            labelee: ''
        },
        methods:{
                selet(e) {
                    console.log(this.labelee)
                }

        },
        created(){

        }
    })

</script>
</html>

你可能感兴趣的:(element-ui)