vue ref 获取子组件属性值
父引入、注册组件并调用组件引入、注册<script>....import CustomerModal from './modules/CustomerModal'export default {name: "CustomerList",mixins:[JeecgListMixin],components: {JDate,...
·
父引入、注册组件并调用组件
引入、注册
<script>
....
import CustomerModal from './modules/CustomerModal'
export default {
name: "CustomerList",
mixins:[JeecgListMixin],
components: {
JDate,
CustomerModal,
JDictSelectTag
},
...
}
</script>
调用组件
<customer-modal ref="modalForm" @ok="modalFormOk"></customer-modal>
// ref属性值指定了从$refs中获取组件的名称
调用子组件的函数
this.$refs.modalForm.add();
调用子组件的属性
this.$refs.modalForm.title = "新增";
更多推荐
已为社区贡献2条内容
所有评论(0)