-
-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support
decorators
and import-attributes
syntax
- Loading branch information
1 parent
75a7d0c
commit c2c0af0
Showing
9 changed files
with
406 additions
and
233 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<script lang="ts"> | ||
import { Component, Prop, Vue } from 'vue-property-decorator' | ||
@Component | ||
export default class MyComponent extends Vue { | ||
@Prop() readonly message!: string | ||
@Prop({ default: 0 }) count!: number | ||
increment() { | ||
this.count++ | ||
} | ||
} | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<p>Message: {{ message }}</p> | ||
<p>Count: {{ count }}</p> | ||
<button @click="increment"> | ||
Increment | ||
</button> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,33 @@ | ||
import { defineComponent } from "@vue/composition-api" | ||
|
||
export default defineComponent({ | ||
name: "Welcome", | ||
setup() { | ||
return () => <p style="color: #fcb80f;cursor: pointer;"> Welcome to here 🚀 .</p> | ||
}, | ||
}) | ||
// import { defineComponent } from "@vue/composition-api" | ||
|
||
// export default defineComponent({ | ||
// name: "Welcome", | ||
// setup() { | ||
// return () => <p style="color: #fcb80f;cursor: pointer;"> Welcome to here 🚀 .</p> | ||
// }, | ||
// }) | ||
|
||
import Vue from 'vue' | ||
import { Component } from 'vue-property-decorator' | ||
|
||
@Component | ||
export default class Welcome extends Vue { | ||
private count = 0 | ||
|
||
private get message(): string { | ||
return `Count: ${this.count}` | ||
} | ||
|
||
private increment(): void { | ||
this.count++ | ||
} | ||
|
||
render() { | ||
return ( | ||
<div> | ||
<h1>{this.message}</h1> | ||
<button onClick={this.increment}>Increment</button> | ||
</div> | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.