Comments (12)
由于设置了 :key="index"
,当 onProvince 变化后 index 的值没有变化,所以 Vue 2.0 不会重新渲染。建议改为 :key="item.name"
,同时在 onProvince 变化后处理一下 onCity 的值。
from element.
el-select组件的onchange方法,执行this.$forceUpdate(); 重新渲染实例就好了
from element.
@Leopoldthecoder 多谢,解决了
from element.
@Leopoldthecoder 写文档里?
from element.
@QingWei-Li Vue本身的不需要写文档吧?
from element.
其实文档里提了一句,可能不太明显,我想想怎么改一下
from element.
@csvwolf 不写的话出问题就赖 Element 🌚
from element.
@QingWei-Li -0-(逃2333
from element.
Leopoldthecoder ,按照你的方法,我同时在 onProvince 变化后处理一下 onCity 的值,发现出现第一个el-option的label值不变,还是不变,
"element-ui": "^1.0.0-rc.4",
"vue": "2.0.0-rc.6",
computed: {
city () {
console.log('cicici', this.onCity)
for (const province of this.maps) {
if (this.onProvince == province.name) {
this.onCity = ''
return province.city
}
}
}
}
from element.
代码如下:
from element.
@perfectyang 我按你说的写了个 Demo:https://jsfiddle.net/gL6mf2te/ ,看起来是正常的。你说的 label 值不变是指什么?
from element.
抱歉, 我也有同样的问题。似乎在mac os 12.4里才会发生。
chrome 58 , element-ui网站上都ok,上面jsfiddle的例子也ok,就是自己使用不行,select后label显示不变。
同样的代码在el captian上就似乎没有问题。
我使用laravel。
多谢!
from element.
Related Issues (20)
- el-table切换页码纵向滚动条消失问题 HOT 1
- el-table切换页码纵向滚动条消失问题
- table组件的展开行,在有些情况下会错位
- [Bug Report] 获取主题预览配置错误 ,503 HOT 14
- css 离线包,组件里的图标显示不出来?谁能解答一下 HOT 4
- 试试手动换成奇舞团的CDN吧:https://cdn.baomitu.com/ HOT 2
- [Feature Request] how to add id to every DOM HOT 1
- [Bug Report] DateTimePicker范围选择器,选中第一个时间以后不选中第二个时间直接点击清空按钮,下一次打开选择会出问题。 HOT 1
- el-table @row-contextmenu event is not working on iPhone mobile.
- [Bug Report] DateTimePicker日期选择器设置firstDayOfWeek:3,导致部分月份日期选择后会顺延7天 HOT 3
- [Feature Request] el-slider 自定义设置标记的固定位置(占整个滑动条长度的百分比),而不是自动计算标记的数据占比的位置 HOT 1
- [Bug Report] Theme editor not working HOT 2
- [Bug Report] el-table 同时使用type和sortable时,显示异常
- [Bug Report] tree组件中事件check-change中的第三个参数值异常
- [Bug Report] After clicking to view the official theme, there is a pop-up error message stating that the service is not available (503)
- [Bug Report] Table组件里的bodyHeight计算逻辑有误 HOT 2
- [Bug Report] 最新版本elemen-ui在webpack里运行table显示空白,在vite里正常 HOT 6
- [Feature Request] 希望el-select在多选的情况下,提供修改选中值el-tag的样式 HOT 5
- [Bug Report] table组件使用toggleRowSelection 出现的bug
- [Bug Report] Textarea autosize does not work in Firefox HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from element.