直接绑定将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>
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。
© 版权声明
THE END
暂无评论内容