网站建设 考核指标,中国建设银行网站宁波,seo营销的概念,苏州哪里做网站前些天发现了一个巨牛的人工智能学习网站#xff0c;通俗易懂#xff0c;风趣幽默#xff0c;忍不住分享一下给大家。点击跳转到教程。
我发现了两种写法。
方法一#xff1a;
子组件#xff1a;
templatebutton clicksubmit提交/but…前些天发现了一个巨牛的人工智能学习网站通俗易懂风趣幽默忍不住分享一下给大家。点击跳转到教程。
我发现了两种写法。
方法一
子组件
templatebutton clicksubmit提交/button
/template
script
export default {methods: {submit: function () {// 子组件中触发父组件方法ee并传值cc12345this.$emit(ee, cc12345)}}
}
/script
父组件
templateeditor ideditor classeditor eecc/editor
/template
script
export default {methods: {cc: function (str) {alert(str)}}
}
/script
方法二 子组件
templatebutton clicksubmit提交/button
/template
script
export default {props: {onsubmit: {type: Function,default: null}},methods: {submit: function () {if (this.onsubmit) {this.onsubmit(‘cc12345’)}}}
}
/script
父组件
templateeditor ideditor classeditor :onsubmitcc/editor
/template
script
export default {methods: {cc: function (str) {alert(str)}}
}
/script
转自https://www.cnblogs.com/caik13/p/6896890.html