<commit_before><script>
import { define, WeElement, html } from 'omi'

define('my-ele', class extends WeElement {
  static propTypes = {
    name: String,
    user: Object
  }

  clickHandle = ()=>{
    this.fire('MyEvent', 'abc')
  }

  render(props) {
    return (
      html`<div onClick=${this.clickHandle}>Hello, ${props.name}! ${props.user.name} ${props.user.age}! </div>
      `
    )
  }
})

export default {
  created(){
    Omi.$.user = { name:'Omi' ,age: 1 }
  },
  methods: {
    myEvent: function(evt) {
      //output abc
      console.log(evt.detail)
    }
  }
}
</script>

<template>
  <my-ele name="Omi" user=":user" @MyEvent="myEvent" />
</template><commit_msg>omi - update vue demo<commit_after><script>
import { define, WeElement, html } from 'omi'

define('my-ele', class extends WeElement {
  static propTypes = {
    name: String,
    user: Object
  }

  clickHandle = ()=>{
    this.fire('MyEvent', 'abc')
  }

  render(props) {
    return (
      html`<div onClick=${this.clickHandle}>Hello, ${props.name}! ${props.user.name} ${props.user.age}! </div>
      `
    )
  }
})

export default {
  created(){
    Omi.$.user = { name:'Omi' ,age: 1 }
  },
  methods: {
    myEvent: function(evt) {
      //output abc
      console.log(evt.detail)

      Omi.$.user.age = 2
      this.$refs.myEle.update()
    }
  }
}
</script>

<template>
  <my-ele ref="myEle" name="Omi" user=":user" @MyEvent="myEvent" />
</template>
{'fraction_non_alphanumeric': 0.1915041782729805, 'fraction_numerical': 0.0020891364902506965, 'mean_word_length': 2.781578947368421, 'pattern_counts': {'":': 2, '<': 17, '<?xml version=': 0, '>': 19, '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': '1764730', 'n_tokens_mistral': 539, 'n_tokens_neox': 533, 'n_words': 102}