怎样让vue更改计算属性但是不更改select的选中值 vue清空select选中的值

 2022-10-20    376  

有的朋友可能对于“怎样让vue更改计算属性但是不更改select的选中值 vue清空select选中的值”还有很多不明白的地方,下面由77ISP云服务器技术小编为大家讲解一下,下面我们来一起看看吧!

这次给大家带来怎样让vue更改计算属性但是不更改select的选中值,vue更改计算属性但是不更改select选中值的注意事项有哪些,下面就是实战案例,一起来看一下。

先上代码:

怎样让vue更改计算属性但是不更改select的选中值 vue清空select选中的值

//...

  

{{item.value}} {{selected}}

var dt = [{ value: '111', label: 'aaa' }, { value: '222', label: 'bbb' }, { value: '333', label: 'ccc' }, { value: '444', label: 'ddd' }, { value: '555', label: 'fff' }]; var vm = new Vue({ el: '#qwe', data: { options: [{ value: '选项1', label: '黄金糕' }, { value: '选项2', label: '双皮奶' }, { value: '选项3', label: '蚵仔煎' }, { value: '选项4', label: '龙须面' }, { value: '选项5', label: '北京烤鸭' }], selected: '' }, computed: { da: function () { var _self = this; return _self.options.filter(function (item) { return +item.value.split('')[2] > 2; }); } } })
以上就是“怎样让vue更改计算属性但是不更改select的选中值 vue清空select选中的值”的详细内容,更多请关注77isp云服务器技术网其它相关文章!

原文链接:https://77isp.com/post/3264.html

=========================================

https://77isp.com/ 为 “云服务器技术网” 唯一官方服务平台,请勿相信其他任何渠道。