07 2024 档案
摘要:默认属性定义,就能够赋值和取值,如果只想取值,那么就可以使用get属性来暴露,外界就没法赋值
阅读全文
摘要:(()=>{ //类接口约束定义 interface IPerson{ //定义一个方法 eat() } interface ISuper{ //定义一个方法 fly() } //定义实现接口的类,可以实现多个接口,用逗号区分 class Person implements IPerson,ISup
阅读全文
摘要:(()=>{ //定义一个函数约束 interface IFunc{ //括号里为函数参数类型 //括号外为函数返回值类型 (name:string,age:number):boolean } //具体函数 const myFunc=function(name:string,age:number):
阅读全文
摘要:(()=>{ //枚举 enum Color{ RED, GREEN } //使用 let color:Color color=Color.RED })()
阅读全文
摘要:(function () { //类 var Person = /** @class */ (function () { function Person(name, age) { this.name = name; this.age = age; } return Person; }()); fun
阅读全文
摘要:interface Person{ name:string age:number } function sayhi(p:Person){ console.log(p.name+" : "+p.age) } let p={ name:'daye', age:18 } console.log(sayhi
阅读全文
摘要:最近写npm包时执行 tsc ./src/index.ts 后,生成的文件没有到dist目录下去。 这是因为tsc ./src/index.ts后会忽略tsconfig.json的配置,所以设置的outDir没有作用,直接使用tsc就可以啦,不用接文件名
阅读全文
摘要:管理cmd或者管理vscode打开terminal都可以,只要是管理身份打开就行,依次输入下面的命令: get-ExecutionPolicy Restricted :受限制的,所以解开限制就行了 set-ExecutionPolicy RemoteSigned 再次输入get-ExecutionP
阅读全文
摘要:父亲定义事件,子接收后触发事件 父: <template> <div class="father"> 父:<br/> <!-- 父给子绑定一个事件,事件名叫xxoo,触发的函数是fuk,需要在父方定义函数fuk --> <Child @xxoo="fuk"/> </div> </template>
阅读全文
摘要:父传子,子传父,本质上都是父亲传递给儿子,只不过如果想要儿子回传数据,那么父亲就事先传递个自己的方法给儿子,儿子接收到这个方法,进行调用,把值传给父亲 父: <template> <div class="father"> <h3>父组件</h3> 车: {{car}} <!-- 父传子在子组件上通过
阅读全文
摘要:https://blog.csdn.net/weixin_69553582/article/details/124966437
阅读全文