|
@@ -0,0 +1,27 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <h1>TS</h1>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup lang="ts">
|
|
|
+import {happy,partOne,aa} from '../types/demo15'
|
|
|
+import { ref, reactive} from 'vue'
|
|
|
+let a = ref(10)
|
|
|
+// 函数 泛型继承接口
|
|
|
+function fn1<T extends happy>(a:T):T {
|
|
|
+ return a;
|
|
|
+}
|
|
|
+let newList:partOne = reactive([
|
|
|
+ {
|
|
|
+ id:1,
|
|
|
+ name:"孙悟空",
|
|
|
+ age:10
|
|
|
+ }
|
|
|
+])
|
|
|
+console.log(aa);
|
|
|
+console.log(fn1({jump:"0"}))
|
|
|
+</script>
|
|
|
+<style lang='scss' scoped>
|
|
|
+
|
|
|
+</style>
|