子组件数据
var data = [
{
id:"1",
name: "频段设置 1",
freq: "88MHz-108MHz,步进25kHz",
data:freqdata
}
]
模态框
<el-dialog title="输入频段信息" :visible.sync="centerDialogVisible" width="630px" :close-on-click-modal="false" center>
<UcenFreqsetting gradfrom="center" ref="data"></UcenFreqsetting>//子组件
<span slot="footer" class="dialog-footer">
<el-button @click="centerDialogVisible = false">取 消</el-button>
<el-button type="primary" v-on:click="addFreq">确 定</el-button>
</span>
</el-dialog>
这个可以解决
但是不建议这么做,需要共享组件数据,那么子组件数据应该在更新时$emit通知父组件。