<template>
<div>
<buttonLink :title.sync='title'>提交buttonLink>
div>
template>
import buttonLink from '@/components/button'
export default {
components:{ buttonLink },
data() {
return {
title:'123'
};
}
};
<template>
<div>
<el-button type='primary' @click='change'>
<slot>submitslot>
el-button>
div>
template>
export default {
props:{
title:{
type:String
}
},
data() {
return {};
},
methods: {
change(){
this.$emit('update:title','456')
}
}
};
</script>