子组件监听父组件值变化的watch监听更新注释,logo间距微调

merge-requests/1/head
张鑫 6 years ago
parent 0c5c411b09
commit 1ece3229cd

@ -145,7 +145,7 @@ export default {
img{ img{
width: 24px; width: 24px;
height: 24px; height: 24px;
margin: 10px; margin:10px 10px 10px 15px;
} }
.logo-title{ .logo-title{
transition-delay: 0.5s; transition-delay: 0.5s;

@ -182,7 +182,7 @@ export default {
//监听并接收父组件的visible并赋值给isShow(子组件接收父组件props传过来的值时不能起一样的类名,会报重复定义的错) //监听并接收父组件的visible并赋值给isShow(子组件接收父组件props传过来的值时不能起一样的类名,会报重复定义的错)
visible: function(newVal){ visible: function(newVal){
this.isShow = newVal; //newVal即是visible this.isShow = newVal; //newVal即是visible
// newVal && this.showConfirm(); //newVal存在的话执行showConfirm函数 // newVal && this.xxx(); //newVal存在的话执行this.xxx()函数
}, },
modelTitle: function(newVal){ modelTitle: function(newVal){
this.title = newVal; this.title = newVal;
@ -290,7 +290,7 @@ export default {
handleCancel() { handleCancel() {
console.log('Clicked cancel button'); console.log('Clicked cancel button');
console.log(this.title); console.log(this.title);
this.$emit('close',false,{}) this.$emit('close',false,{}) //第二个参数表示每次$emit的时候就将modelData重新赋值,使watch 监听的modelData:函数不断监听到变化而触发,解决默认只触发一次下次再点开详情为空值的问题
}, },
handleSelectChangeLeft(value) { handleSelectChangeLeft(value) {

Loading…
Cancel
Save