Coder Social home page Coder Social logo

Comments (12)

Leopoldthecoder avatar Leopoldthecoder commented on April 20, 2024 1

由于设置了 :key="index",当 onProvince 变化后 index 的值没有变化,所以 Vue 2.0 不会重新渲染。建议改为 :key="item.name",同时在 onProvince 变化后处理一下 onCity 的值。

from element.

tomastong avatar tomastong commented on April 20, 2024 1

el-select组件的onchange方法,执行this.$forceUpdate(); 重新渲染实例就好了

from element.

tdida avatar tdida commented on April 20, 2024

@Leopoldthecoder 多谢,解决了

from element.

QingWei-Li avatar QingWei-Li commented on April 20, 2024

@Leopoldthecoder 写文档里?

from element.

csvwolf avatar csvwolf commented on April 20, 2024

@QingWei-Li Vue本身的不需要写文档吧?

from element.

Leopoldthecoder avatar Leopoldthecoder commented on April 20, 2024

其实文档里提了一句,可能不太明显,我想想怎么改一下

from element.

QingWei-Li avatar QingWei-Li commented on April 20, 2024

@csvwolf 不写的话出问题就赖 Element 🌚

from element.

csvwolf avatar csvwolf commented on April 20, 2024

@QingWei-Li -0-(逃2333

from element.

perfectyang avatar perfectyang commented on April 20, 2024

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.

perfectyang avatar perfectyang commented on April 20, 2024

代码如下:







from element.

Leopoldthecoder avatar Leopoldthecoder commented on April 20, 2024

@perfectyang 我按你说的写了个 Demo:https://jsfiddle.net/gL6mf2te/ ,看起来是正常的。你说的 label 值不变是指什么?

from element.

maverickchangithub avatar maverickchangithub commented on April 20, 2024

抱歉, 我也有同样的问题。似乎在mac os 12.4里才会发生。
chrome 58 , element-ui网站上都ok,上面jsfiddle的例子也ok,就是自己使用不行,select后label显示不变。
同样的代码在el captian上就似乎没有问题。
我使用laravel。
多谢!

from element.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.