Put ref=”childComponent” on the child component’s instance in the parent component and access it from that ref’s method like this: <childcomponent ref=”childComponent” /> var self=this; self.$refs.chldComponent.<method>
Category: Technology
VueJS: Unknown custom element
Unknown custom element: – did you register the component correctly? For recursive components, make sure to provide the “name” option. When declaring child component in the components section of the export in the parent component, explicitly specify the name like this: export { components :{ myComponent: MyComponent }, data(){ return {}; }
VueJS: Pass data from child component to parent component.
Create prop in child component: props: { childDataProp: { type: Array, default () => []}} Create a data variable: data(){ return {childData:[]};} Populate value for the data variable created above. childData = [1,2,3,4,5]; Use $emit to expose an event as the first argument and data as the second argument: this.$emit(‘eventName’,childData); In Parent Component: a. In…
HICKERY – xcopy Command
Tired of all the prompts while copying files? Here is a better/efficient way to copy files around. This command is especially helpful when copying tens of gigabytes of files, for example backing up your c drive into an external hard drive. Here we have some files in the source folder: You can use the following…