废话不多说,直接上干货
<template>
<div id="container">
<strong>{{ name }}</strong>
<p>Explore <a target="_blank" rel="noopener noreferrer" href="https://ionicframework.com/docs/components">UI
Components</a></p>
<ion-button @click="changeName">获取name</ion-button>
</div>
</template>
<script lang="ts">
import { Vue, prop } from 'vue-class-component';
class Props {
name?: string;
baz = prop<string>({default: '11111'});
}
export default class ExploreContainer extends Vue.with(Props) {
changeName() {
this.$emit('names', 111111);
}
}
</script>