select的默认选择项问题

这篇文章主要介绍了详解element-ui中el-select的默认选择项问题,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧

直接绑定将option中的value值绑定给v-model

<template> <div> <el-select v-model="query"> <el-option v-for="item in options" :key="item.value" :value="item.value" :label="item.label"></el-option> </el-select> </div> </template> <script> export default{ data() { return { options: [{ value: '01', label: '我的' }, { value: '02', label: '你的' }, { value: '03', label: '他的' }], query: '02' } } } </script> <style></style>

select的默认选择项问题

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。

您可能感兴趣的文章:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/eb312d74f51eb0f928294d3e4d1493fa.html