vue3+ts demo
时间: 2023-08-21 17:06:12 浏览: 129
以下是一个Vue 3使用TypeScript的示例代码:
```typescript
<template>
<div class="home">
<render-input :msg="title" @updateMsg="updateMsg" />
</div>
</template>
<script lang="ts">
import { Options, Vue } from 'vue-class-component';
import renderInput from './components/render-components2.vue';
@Options({
components: {
renderInput,
},
})
export default class Home extends Vue {
public title = 'title';
public updateMsg(val: any) {
console.log('23um', val);
this.title = val;
}
}
</script>
```
这是一个Vue 3的父组件示例代码。它使用了TypeScript语言,并引入了一个名为`renderInput`的子组件。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [vue3+ts:render极简demo -- 引入element ui el-input组件](https://blog.csdn.net/snowball_li/article/details/123971089)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文