current position:Home>Select in element uses typescript to define initial data, which has no effect

Select in element uses typescript to define initial data, which has no effect

2022-06-24 07:52:22Zhangxiaolang

This is a Element Original template given

I defined in the module value Initial data

here ,element Of select Events have no effect ,value It's always empty

Here you need to define @change Method makes value Data changes

<el-select v-model="value" placeholder=" Please select " @change="change()">
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value">
            </el-option>
          </el-select>

Define methods in modules

change(){
		this.$forceUpdate()
	}

So you select The effect of

copyright notice
author[Zhangxiaolang],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2022/175/202206240328341719.html

Random recommended