1.1.2 • Published 3 years ago

mynumbercom-hyj v1.1.2

Weekly downloads
1
License
MIT
Repository
-
Last release
3 years ago

mynumbercom

A component

Build Setup

# install 
npm i mynumbercom-hyj

# after main.js
import numberComhyj from "mynumbercom-hyj"
Vue.component('mynumbercom',numberComhyj)

# after vue
<mynumbercom :num1="num1" :num2="num2" v-on:getSumFromChild="receiveChildSum"></mynumbercom>

 data () {
    return {
      num1: 4,
      num2: 5,
      sumFromChild:0,
    }
  },
  methods:{
    receiveChildSum(sum){ //自定义事件,接收子组件的和
      this.sumFromChild = sum;
    }
  }

For detailed explanation on how things work, consult the docs for vue-loader.