<commit_before>import { VueConstructor, default as Vue } from 'vue';
import { FrameworkDelegate, ViewLifecycle } from '@ionic/core';
import { EsModule, HTMLVueElement, WebpackFunction } from '../interfaces';


// Handle creation of sync and async components
function createVueComponent(vue: VueConstructor, component: WebpackFunction | object | VueConstructor): Promise<VueConstructor> {
  return Promise.resolve(
    typeof component === 'function' && (component as WebpackFunction).cid === undefined
      ? (component as WebpackFunction)().then((cmp: any) => vue.extend(isESModule(cmp) ? cmp.default : cmp))
      : vue.extend(component)
  );
}

export class VueDelegate implements FrameworkDelegate {
  constructor(
    public vue: VueConstructor,
    public $root: Vue
  ) {}

  // Attach the passed Vue component to DOM
  attachViewToDom(parentElement: HTMLElement, component: HTMLElement | WebpackFunction | object | VueConstructor, opts?: object, classes?: string[]): Promise<HTMLElement> {
    // Handle HTML elements
    if (isElement(component)) {
      // Add any classes to the element
      addClasses(component as HTMLElement, classes);

      // Append the element to DOM
      parentElement.appendChild(component as HTMLElement);
      bindLifecycleEvents(component, parentElement);
      return Promise.resolve(component as HTMLElement);
    }

    // Get the Vue controller
    return createVueComponent(this.vue, component).then((Component: VueConstructor) => {
      const componentInstance = new Component({
        propsData: opts
      });
      componentInstance.$mount();<commit_msg>fix(vue): correct passing of props and data to components (#17188)<commit_after>import { VueConstructor, default as Vue } from 'vue';
import { FrameworkDelegate, ViewLifecycle } from '@ionic/core';
import { EsModule, HTMLVueElement, WebpackFunction } from '../interfaces';


// Handle creation of sync and async components
function createVueComponent(vue: VueConstructor, component: WebpackFunction | object | VueConstructor): Promise<VueConstructor> {
  return Promise.resolve(
    typeof component === 'function' && (component as WebpackFunction).cid === undefined
      ? (component as WebpackFunction)().then((cmp: any) => vue.extend(isESModule(cmp) ? cmp.default : cmp))
      : vue.extend(component)
  );
}

export class VueDelegate implements FrameworkDelegate {
  constructor(
    public vue: VueConstructor,
    public $root: Vue
  ) {}

  // Attach the passed Vue component to DOM
  attachViewToDom(parentElement: HTMLElement, component: HTMLElement | WebpackFunction | object | VueConstructor, opts?: object, classes?: string[]): Promise<HTMLElement> {
    // Handle HTML elements
    if (isElement(component)) {
      // Add any classes to the element
      addClasses(component as HTMLElement, classes);

      // Append the element to DOM
      parentElement.appendChild(component as HTMLElement);
      bindLifecycleEvents(component, parentElement);
      return Promise.resolve(component as HTMLElement);
    }

    // Get the Vue controller
    return createVueComponent(this.vue, component).then((Component: VueConstructor) => {
      const componentInstance = new Component(opts);
      componentInstance.$mount();
{'fraction_non_alphanumeric': 0.10456508328192474, 'fraction_numerical': 0.0015422578655151142, 'mean_word_length': 4.239095315024232, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4422774', 'n_tokens_mistral': 865, 'n_tokens_neox': 861, 'n_words': 256}